• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Devaka's PracticeExam3 Q.No 7

 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from Devaka's PracticeExam3 Q.No 7

Answer is Compile time Error.

But I am getting error at Runtime that is java.lang.VerifyError

Is this Compile Time Error or Runtime Error???
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it must be a compilation error. How did you compile the program??
 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using eclipse. It compiled fine. At Runtime I got VerifyError.

when using //VerifyError at Runtime


But // compiles fine .....giving output false
 
Anne Mac
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure how you got it to compile.

I'm using Eclipse 3.4, defaults to Java 1.6, on WindowsXP, and it won't compile for me.
In fact, neither will the "34 instanceof Integer".
???
What eclipse are you using, and on what operating system?

I'm just curious.
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Banu Chowdary wrote:
// compiles fine .....giving output false


Unbelievable

For me, I'm getting a compile time error:


 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using eclipse 3.1 and OS is Windows XP.

I tried to send the screen shot of my program. But its not allowing .doc attachments.


 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the Java version, you have?
 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.5 version. If I use 1.4 I am getting Compiler Errors.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should get a compile time error even with JDK1.5

unexpected type
found : int
required: reference
boolean b= it.intValue() instanceof Integer;
^
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Monu Tripathi wrote:You should get a compile time error even with JDK1.5

unexpected type
found : int
required: reference
boolean b= it.intValue() instanceof Integer;
^


With JDK 1.6 too.
 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will this also should give compiler error???
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Banu Chowdary wrote:will this also should give compiler error???


Yes, for sure!
 
James Tharakan
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is important to find out which compiles and which does not compile USING command prompt because the test's answer is not based on any IDE's answers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic