Require HELP, Please


//////////////////////////////////////////Computer.java
Java Code: package customer; import java.util.*; abstract class Computer { public String make; public String cpuType; public double cpuSpeed; public int ramMemory; public String graphicCard; public int hardDrive; public int monitorSize; public double price; public void createComputer(){ // MAKE Scanner input = new Scanner (System.in); System.out.println("Please enter the Make of the Desktop. Eg: DELL, Samsung, Sony"); System.out.print("Your Input: "); String mk = input.next(); this.make = mk; } public void DisplayC(){ System.out.println("Make : "+make); } } mh_sh_highlight_all('java'); ///////////////////////////////////////////////////////////// Desktop.java
Java Code: package customer; import java.util.*; class Desktop extends Computer{ public String mouse; public String keyboard; public void intputOpt1(){ System.out.println("You want to create a Desktop."); Computer d1 = new Desktop();// d1.createComputer(); } public void selectMouse(){ System.out.println("Please select one option."); System.out.println("__________________________"); System.out.println("'1': wireless Mouse."); System.out.println("'2': without wireless Mouse."); System.out.println("__________________________"); System.out.print("Your Input: "); Scanner input= new Scanner(System.in); mouse= input.next(); char m = mouse.charAt(0); while(m != '1' && m != '2'){ System.out.println("ERROR: Incorrect input. Please Try Again"); mouse= input.next(); m = mouse.charAt(0); } if(m == '1'){ mouse= "Wireless Mouse"; } else{ mouse= "Without wireless Mouse"; } System.out.println(); } public void selectKeyboard(){ System.out.println("Please select one option."); System.out.println("__________________________"); System.out.println("'1': wireless Keyboard."); System.out.println("'2': without wireless Keyboard."); System.out.println("__________________________"); System.out.print("Your Input: "); Scanner input= new Scanner(System.in); keyboard= input.next(); char m = keyboard.charAt(0); while(m != '1' && m != '2'){ System.out.println("ERROR: Incorrect input. Please Try Again"); keyboard= input.next(); m = keyboard.charAt(0); } if(m == '1'){ keyboard= "Wireless Keyboard"; } else{ keyboard= "Without wireless Keyboard"; } System.out.println(); } public void DisplayD(){ System.out.println("Mouse Type : "+mouse); System.out.println("Keyboard Type : "+keyboard); this.DisplayC(); } } mh_sh_highlight_all('java'); //////////////////////////////////////// Menu.java
Java Code: package customer; import java.util.*; public class Menu { public static void main(String[] args) { Desktop d1=new Desktop(); d1.selectKeyboard(); d1.selectMouse(); // then it access the computer option which is make d1.intputOpt1(); // Displays what options have been selected for the desktop. d1.DisplayD(); } mh_sh_highlight_all('java'); ////////////////////// 3 Java Files ///////////////////////
It displayes the keyboard and the mouse. the only one that is showing 'null' is the make which is in the Computer.java.

Any solution will be helpful. Thank you in advance. , Thank you very much!!;-)
This problem is solved.
Posted On: Thursday 25th of October 2012 01:51:40 AM Total Views:  49
View Complete with Replies

RELATED TOPICS OF Java PROGRAMMING LANGUAGE