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 student
  9. {
  10. int id;
  11. String name;
  12. student(int i, String str){
  13. id = i;
  14. name = str;
  15. }
  16. void display(){
  17. System.out.println(id + " " + name);
  18. }
  19. public static void main (String[] args) throws java.lang.Exception
  20. {
  21. student obj = new student(12,"vaishnavi");
  22. obj.display();
  23. // your code goes here
  24. }
  25. }
Success #stdin #stdout 0.14s 54412KB
stdin
Standard input is empty
stdout
12 vaishnavi