fork download
  1. class Student{
  2. String name;
  3. int rollNo;
  4. Student(int num){
  5. rollNo = num;
  6. }
  7. public void print(){
  8. System.out.print(name +" " + rollNo+" ");
  9. }
  10. }
  11.  
  12. class Ideone {
  13. public static void main(String[] args) {
  14. Student s = new Student(12);
  15. s.print();
  16. }
  17. }
Success #stdin #stdout 0.12s 36208KB
stdin
Standard input is empty
stdout
null 12