I am getting exception errorn in for thread main java lang error -
i beginner in java , getting error
"exception in thread "main" java.lang.error: unresolved compilation problem: "
below code:
public class second { string name; int age; } public class seco { public static void main(string[] args) { second display = new second(); display.name = "gunwant"; display.age = 37; system.out.println(display.age); system.out.println(display.name); } }
hello satya should put class seco in file called seco.java , class second in file called second.java or remove 'public' 'public class second' :
class second { string name; int age; } public class seco { public static void main(string[] args) { second display = new second(); display.name = "gunwant"; display.age = 37; system.out.println(display.age); system.out.println(display.name); } }
this way should work
Comments
Post a Comment