fork download
  1. class Person
  2. {
  3. private String name, address;
  4. private double age;
  5. private String number;
  6.  
  7. public Person()
  8. {
  9. name = "Brother Bob";
  10. address = "4720 Fifth Avenue Pittsburgh PA 15213";
  11. age = 100;
  12. number = "4122083421";
  13. }
  14.  
  15. public Person(String n, String a, double b, String c)
  16. {
  17. name = n;
  18. address = a;
  19. age = b;
  20. number = c;
  21. }
  22.  
  23. public String getName()
  24. {
  25. return name;
  26. }
  27.  
  28. public String getAddress()
  29. {
  30. return address;
  31. }
  32.  
  33. public double getAge()
  34. {
  35. return age;
  36. }
  37.  
  38. public String getNumber()
  39. {
  40. return number;
  41. }
  42. }
  43. class PersonalInfo
  44. {
  45. public static void main (String[] args)
  46. {
  47.  
  48.  
  49. Person p1 = new Person();
  50. System.out.println("Our persons name is "+ getName());
  51. System.out.println("Their address is " + getAddress());
  52. System.out.println("Their age is " + getAge());
  53. System.out.println("Their phone number is " + getNumber());
  54.  
  55. Person p2 = new Person("Michael Blackwell", "1234 Shady Avenue Pittsburgh PA 15217", 17, "4120000001");
  56. System.out.println("Our person is named " + getName());
  57. System.out.println("They live at " + getAddress());
  58. System.out.println("They are " + getAge() + " years old");
  59. System.out.println("To call them, call " + getNumber());
  60.  
  61. }
  62. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:50: error: cannot find symbol
		 System.out.println("Our persons name is "+ getName());
		                                            ^
  symbol:   method getName()
  location: class PersonalInfo
Main.java:51: error: cannot find symbol
		 System.out.println("Their address is " + getAddress());
		                                          ^
  symbol:   method getAddress()
  location: class PersonalInfo
Main.java:52: error: cannot find symbol
		 System.out.println("Their age is " + getAge());
		                                      ^
  symbol:   method getAge()
  location: class PersonalInfo
Main.java:53: error: cannot find symbol
		 System.out.println("Their phone number is " + getNumber());
		                                               ^
  symbol:   method getNumber()
  location: class PersonalInfo
Main.java:56: error: cannot find symbol
		 System.out.println("Our person is named " + getName());
		                                             ^
  symbol:   method getName()
  location: class PersonalInfo
Main.java:57: error: cannot find symbol
		 System.out.println("They live at " + getAddress());
		                                      ^
  symbol:   method getAddress()
  location: class PersonalInfo
Main.java:58: error: cannot find symbol
		 System.out.println("They are " + getAge() + " years old");
		                                  ^
  symbol:   method getAge()
  location: class PersonalInfo
Main.java:59: error: cannot find symbol
		 System.out.println("To call them, call " + getNumber());
		                                            ^
  symbol:   method getNumber()
  location: class PersonalInfo
8 errors
stdout
Standard output is empty