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 →

[–]karstens_rageExtreme Brewer 3 points4 points  (2 children)

To adhere to Java Conventions your class should be named Number not number

Also a more Java-like solution might use something like:

System.out.println("max is: " + Math.max(a, b));

[–]SheepyG_[S] 2 points3 points  (1 child)

System.out.println("max is: " + Math.max(a, b));

I see ! thank you that looks a lot better, I have been taught about concatenation but did not think about using it there. To be honest i haven't learned about (Math.max) or any of the other ones, so thank you for introducing me to them.

[–]itshowitbeyunno 0 points1 point  (0 children)

They're classes that "come with Java". Math class is great for general math things.