aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Devaka's PracticeExam3 Q.No 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Devaka Watch "Devaka New topic
Author

Devaka's PracticeExam3 Q.No 7

Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 182

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

Joined: Aug 03, 2008
Posts: 9321
    
  17

Well it must be a compilation error. How did you compile the program??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 182

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

Joined: Jan 27, 2009
Posts: 1
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

Joined: Nov 12, 2008
Posts: 757
Banu Chowdary wrote:
// compiles fine .....giving output false


Unbelievable

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


Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 182

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

Joined: Nov 12, 2008
Posts: 757
What is the Java version, you have?
Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 182

1.5 version. If I use 1.4 I am getting Compiler Errors.
Monu Tripathi
Rancher

Joined: Oct 12, 2008
Posts: 1369
    
    1

You should get a compile time error even with JDK1.5

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


[List of FAQs] | [Android FAQ] | [Samuh Varta]
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
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

Joined: Apr 23, 2007
Posts: 182

will this also should give compiler error???
Treimin Clark
Ranch Hand

Joined: Nov 12, 2008
Posts: 757
Banu Chowdary wrote:will this also should give compiler error???


Yes, for sure!
James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

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.


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Devaka's PracticeExam3 Q.No 7