fork(1) download
  1. class Student
  2. {
  3. String first;
  4. String last;
  5. int age;
  6. int height;
  7.  
  8. public Student ()
  9. {
  10. first = "Bob";
  11. last = "Green";
  12. age = 18;
  13. height = 60;
  14. }
  15. public Student (String f,String l,int a,int h)
  16. {
  17. first = f;
  18. last = l;
  19. age = a;
  20. height = h;
  21. }
  22. public String Info ()
  23. {
  24. return "First Name :"+ first +" ,Last Name :"+last+ " ,Age :"+age+" ,Height in inches :"+height;
  25. }
  26.  
  27. }
  28. class Roster
  29. {
  30. private Student [] Students = new Student[3];
  31. Student one = new Student("alfy","alfy",4,6);
  32. Student two = new Student("y","r",34,76);
  33. Student three = new Student("ytr","wed",88,21);
  34. Students[0] = one;
  35. Students[1] = two;
  36. Students[2] = three;
  37. public Roster ()
  38. {
  39. Students[]
  40. }
  41. public String caca ()
  42. {
  43. return "hi";
  44. }
  45. public static void main (String[] args)
  46. {
  47. Roster classOf2016 = new Roster();
  48. System.out.println(classof2016.caca());
  49.  
  50. }
  51. }
Compilation error #stdin compilation error #stdout 0.04s 711168KB
stdin
Standard input is empty
compilation info
Main.java:34: error: ']' expected
	Students[0] = one;
	         ^
Main.java:34: error: ';' expected
	Students[0] = one;
	          ^
Main.java:34: error: illegal start of type
	Students[0] = one;
	            ^
Main.java:35: error: ']' expected
	Students[1] = two;
	         ^
Main.java:35: error: ';' expected
	Students[1] = two;
	          ^
Main.java:35: error: illegal start of type
	Students[1] = two;
	            ^
Main.java:36: error: ']' expected
	Students[2] = three;
	         ^
Main.java:36: error: ';' expected
	Students[2] = three;
	          ^
Main.java:36: error: illegal start of type
	Students[2] = three;
	            ^
Main.java:39: error: not a statement
	Students[]
	        ^
Main.java:39: error: ';' expected
	Students[]
	          ^
11 errors
stdout
Standard output is empty