im getting "var cannot be resolved to a type" error [message #1826508] |
Sun, 26 April 2020 06:46 |
Fort vin Messages: 2 Registered: April 2020 |
Junior Member |
|
|
hey guys! i just started java and my first problem occured, but i guess there is something to be fixed in compiler. im getting a var error. for some reason the compiler cannot recognize var
ive been googling and ive noticed that it is a common "issue"
any one here who can help me out? im using eclipse 4.15.0
thanks
public class VarDemo2 {
ppublic class VarDemo2 {
public static void main(String args[]) {
var mc = new MyClass(10);
System.out.println("Value of i in mc is " +
mc.geti());
mc.seti(19);
System.out.println("Value of i in mc is now "
+ mc.get());
}
}
}
Error: Exception in thread "main" java.lang.Error: Unresolved compilation problem:
var cannot be resolved to a type
at VarDemo2.main([VarDemo2.java:4]
[Updated on: Mon, 15 February 2021 14:52] by Moderator Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02234 seconds