查看完整版本 : Error are Showing in Java Program

ankitdixit 2022-3-31 20:12

Hello All, I am working on java project and facing an error in below code. The code below won't compile, why?[code]System.out.println(Void.class instanceof Class);[/code]This won't compile either[code]//according to oracle doc, the type of Void.TYPE is ClassSystem.out.println(Void.TYPE instanceof Class);[/code]Errors are showing:[code]VoidTest.java:6: inconvertible types found : java.lang.Classrequired: Class System.out.println(Void.TYPE instanceof Class); [/code]And I am using Darwin Kernel Version 12.4.0 and Java version "1.6.0_51"
They won't compile using emacs + java + javac
I am using online compiler to compiler the program from here: [url=https://www.interviewbit.com/online-java-compiler/]https://www.interviewbit.com/online-java-compiler/[/url]
頁: [1]
查看完整版本: Error are Showing in Java Program