fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7.  
  8. class Person
  9. {
  10. private int age;
  11. public Person(){}
  12. //
  13. public Person(int age)
  14. {
  15. this.age = age;
  16. }
  17. public void setAge(int age)
  18. {
  19. this.age = age;
  20. }
  21. public int getAge()
  22. {
  23. return this.age;
  24. }
  25. }
  26.  
  27. /* Name of the class has to be "Main" only if the class is public. */
  28. class Ideone
  29. {
  30. public static void main (String[] args) throws java.lang.Exception
  31. {
  32. // your code goes here
  33. //
  34. final int[] iArr = {5,6666,99,45,3};
  35. System.out.println(Arrays.toString(iArr));
  36. //
  37. Arrays.sort(iArr);
  38. System.out.println(Arrays.toString(iArr));
  39. //
  40. iArr[2] = -65;
  41. System.out.println(Arrays.toString(iArr));
  42. //
  43. //iArr = null;
  44. //
  45. Person p = new Person(6);
  46. p.setAge(23);
  47. System.out.println(p.getAge());
  48. //p = null;
  49. }
  50. }
  51.  
  52.  
  53.  
  54.  
  55.  
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
[5, 6666, 99, 45, 3]
[3, 5, 45, 99, 6666]
[3, 5, -65, 99, 6666]
23