Syntax import java.*; import java.io.*; class student { int id =5; String name="pl"; public static void main(String arg[]) { student s1 = new student(); System.out.println(s1.id); // int default = 0 System.out.println(s1.name); // String default = null } }
OUTPUT
0 null
See How to Implement This Program :please Subscribed this tutorial to : Click here