英文:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:at Datatypes.main(Datatypes.java:4)
问题
package corejava;
public class Datatypes {
public static void main(String[] args) {
//byte
byte num1 = 100;
System.out.println(num1);
//short
short num2 = 100;
System.out.println(num2);
//int
int num3 = 15000;
System.out.println(num3);
//long
long num4 = 5555555555L;
System.out.println(num4);
//float
float num5 = 15.254f;
System.out.println(num5);
//double
double num6 = 15.28484;
System.out.println(num6);
//char
char ch = 'A';
System.out.println(ch);
//String
String str = "SG Testing Institute";
System.out.println(str);
}
}
ERROR:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Datatypes.main(Datatypes.java:4)
英文:
package corejava;
public class Datatypes {
public static void main(String[] args) {
//byte
byte num1 = 100;
System.out.println(num1);
//short
short num2 = 100;
System.out.println(num2);
//int
int num3 = 15000;
System.out.println(num3);
//long
long num4 = 5555555555L;
System.out.println(num4);
//float
float num5 = 15.254f;
System.out.println(num5);
//double
double num6 = 15.28484;
System.out.println(num6);
//char
char ch = 'A';
System.out.println(ch);
//String
String str = "SG Testing Institute";
System.out.println(str);
}
}
ERROR:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Datatypes.main(Datatypes.java:4)
答案1
得分: 0
在我的电脑上运行得非常正常.. 输出如下:
100 100 15000 5555555555 15.254 15.28484 A SG 测试学院
请您检查 JDK 设置。
英文:
Working perfectly fine in my pc ..giving below output
100 100 15000 5555555555 15.254 15.28484 A SG Testing Institute
Can you please check JDK settings
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论