File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Whizlabs question doubt. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Whizlabs question doubt." Watch "Whizlabs question doubt." New topic
Author

Whizlabs question doubt.

Alex Serna
Ranch Hand

Joined: Sep 18, 2009
Posts: 58
Hi everyone,

I found this question on a mock exam from Whizlabs and I don't really understand why it is this way:



I thought this would give a compile error since "d" is a Double and we are assigning it a Boolean. The explanation says that "d" gets redeclared. I thought that you couldn't redeclare a variable in java, that you could only shadow an existing variable...

Thanks!
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

This statement won't create a variable in the generated servlet file. It will be something like this


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Alex Serna
Ranch Hand

Joined: Sep 18, 2009
Posts: 58
Thank you Ankit!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Whizlabs question doubt.
 
Similar Threads
Generics Question - Reference type
EL Question
Anothe one from Whizlabs software.
Wrapper classes
Question on NumberFormat