Below is a piece of code given me for debugging. I have made a number of changes (noted in code) but still recieve a compile error. Any thoughts will be much appreciated.

My changes-
this was Debug d = new Debug();

this was public method2()

// this class should print to the screen:
// y is 8
// tmp is 20.0 
import java.lang.*;
public class Debug1 extends java.lang.Object
public void main(String[] arguments) 
Debug d = new Debug1(); // this was Debug d = new Debug();
int x = 2;
int y = method1(x);
System.out.println("y is " + y);
double tmp =method2();
System.out.println("tmp is " + tmp);
public int method1(int xxx) 
return xxx*4;
public double method2() // this was public method2()
double x = Math.random();
double y = Math.max(3 * x, 20.0);
return y;
12 Years
Discussion Span
Last Post by phovasia

Thank you very much. You really need a good eye to catch these things. I am afraid I do not posess such a trait.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.