fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class rect
  9. {
  10. private int a;
  11. private int b;
  12. public rect(int a, int b)
  13. {
  14. this.a = a;
  15. this.b = b;
  16. }
  17. public void ShowVariables()
  18. {
  19. System.out.println(a + " " + b);
  20. }
  21. }
  22. class Ideone
  23. {
  24. public static void main (String[] args) throws java.lang.Exception
  25. {
  26. rect rectangle1 = new rect(4, 5);
  27. rectangle1.ShowVariables();
  28. }
  29. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
4 5