wood burning stoves*
The moose likes Beginning Java and the fly likes Simple (?) static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Simple (?) static method" Watch "Simple (?) static method" New topic
Author

Simple (?) static method

V��r� Tunnus
Greenhorn

Joined: Mar 29, 2006
Posts: 8
Hi. I'm now studying static methods and got stucked in one excercise which I found from the net. So, I should make one class which only contains one static method (let's call it as staticMethod). I know how to create it, but then I can't understand the next thing: "This staticMethod should get one scanner-object as it's parameter and it may throw RuntimeExceptions." I just can't get it cleared to myself how I define this method to get scanner-object as it's parameter.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18542
    
  40

Hard to tell since this example is "found from the net"... But I would assume that the "scanner object" that it is referring to is an instance of the "java.util.Scanner" class.

BTW, you need Java 5 (at least), for access to the Scanner class.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
 
subject: Simple (?) static method
 
Similar Threads
Please clarify my doubts about static methods
Inheritance of static methods
hide vs override
Why the interviewer challenged me?
A basic qn regarding static keyword.