Answer to Question #11068 in Java | JSP | JSF for midya

Question #11068
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.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS