PDA

Click to See Complete Forum and Search --> : Function Call Question


Striver2000
Nov 19th, 2003, 12:24 PM
Can someone tell me how I would I call a Function in Java?

Dillinger4
Nov 19th, 2003, 12:50 PM
For a non-static method you would need a handle to an object. For a static method you can just make the call via the class name.

Dillinger4
Nov 19th, 2003, 12:56 PM
public class X{
public static void main(String[] args){

String s = String.valueOf(525); static call
System.out.println(s);
String s2 = s.substring(0,2); // non-static call
System.out.println(s2);
}
}