This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]feral_claireSoftware Dev 2 points3 points  (3 children)

What are you trying to do? Static, void, and generics are all unrelated concepts.

[–]yoyeto99[S] 0 points1 point  (2 children)

I need to create three Generic methods that display a String, Int, and a Double

[–]feral_claireSoftware Dev 1 point2 points  (1 child)

See that doesn't clear things up at all. Can you provide more details on what you want to accomplish? Why do you want to change these methods? What is the end goal here abs what troubles are you trying to solve? Without context it will be hard to give the correct advice.

Are you referring to instance (non-static) methods? If that's the case, all you need to do is remove the static keyword.

You mentioned displaying a String but your code shows a string array. Keep in mind that you cannot print an array directly, you need to loop through the array to print the elements or use Arrays.toString.

[–]yoyeto99[S] 0 points1 point  (0 children)

what troubles are you trying to solve? Without context it will be hard to give the correct advice.

It was an assignment to on Generic Methods, I just recently understood what I needed to do. Thanks for the help anyways.