public class Over {
public int stack(int j, int k) { return j + k; }
public int stack(int m) {
return m * m;
}
public int stack(float f) {
return (int)f * 5;
}
public static void main(String args[]) {
int n = 3;
float f = 3;
Over o = new Over();
System.out.println("" + o.stack(n, n));
System.out.println("" + o.stack(n));
System.out.println("" + o.stack(f));
}
}
what is this line do ? =====> over o = new over(); what is happen if we dont use this line?
1
Expert's answer
2012-06-22T08:42:27-0400
This line of code creates a new object class Over. Newly created object are using in the code below, so if you remove the creation of the object, your compiler will print an error.
Comments
Leave a comment