Exception in thread "main" java.lang.Error: Unresolved compilation problem:at Datatypes.main(Datatypes.java:4)

huangapple go评论62阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年9月27日 11:40:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/64084561.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定