By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Oh and if you are going to be running this class without a driver class (another class that creates instances of Phone and runs the program), you will need a main method at the top:

public static void main(String[] args){
Phone test1 = new Phone("Flowers");
test1.setNumber();
System.out.println(test1.number); //may have to change the String number variable to public rather than private.
//This is just to test and make sure it got the correct result by printing it to the console.

}

Oh and if you need a very good Java development environment, download Eclipse:
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-SDK-3.5.1-win32.zip