fork download
  1. class Tutorial {
  2. String tutName;
  3. int tutNo;
  4. public static void main(String[] args)
  5. {
  6. Tutorial tut = new Tutorial();
  7. Tutorial tut1= new Tutorial();
  8. tut.tutName="Java";
  9. tut.tutNo=2;
  10. System.out.print("Tutorial Number " + tut.tutNo + "is " +tut.tutName);
  11. System.out.print("Tutorial Number " + tut1.tutNo + "is " +tut1.tutName);
  12. }
  13. }
Success #stdin #stdout 0.16s 57540KB
stdin
public class Tutorial {
String tutName;
int tutNo;
public static void main(String[] args)  {
    Tutorial tut= new Tutorial();
    tut.tutName="Java";
    System.out.print(tut.tutName);
    }
}
stdout
Tutorial Number 2is JavaTutorial Number 0is null