You need to look into the details of static and instance methods.
The static methods belong to the class, and therefore do not require an instance of the class to exist in order to invoke them. All the methods in the java.lang.Math class are static.
On the other hand, instance methods belong to a particular instance of the class and you require a instance of it to invoke them. That is the case of the Scanner class you mentioned above. [ March 17, 2007: Message edited by: Edwin Dalorzo ]
Static methods (Math.random()) can be access without creating an instance of the object. To access the public methods you need to create an instance of the class.
Joined: Dec 31, 2004
To access the public methods you need to create an instance of the class.
I am affraid this is not true. The methods in question in the java.lang.Math class are public, however, since they are static, they do not require an instance of the java.lang.Math class to use them. [ March 17, 2007: Message edited by: Edwin Dalorzo ]