This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes errata or ?? 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 » Mock Exam Errata
Bookmark "errata or ??" Watch "errata or ??" New topic
Author

errata or ??

R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
que is from : http://www.4tests.com/exams/questions.asp
6) Which of the following are acceptable?
[check bixes are there - RK]
Object o = new Button("A");
Frame f = new Panel();
Boolean flag = true; // 3
Boolean flag = true; // 4
Panel p = new Applet();


====
My prob is that ... I can not distinguish the diffrence betn 3 & 4 ...
is it same with every one ...
is it errata
TIA


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
yeah I think it is an errata... Typical cut-paste problem...
I'm moving this to Mock Exam Errata


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Moya Green
Ranch Hand

Joined: Jan 24, 2002
Posts: 49
I met the same question in John Hunt Mock exam. Could anyone explain to me why
---------------------------
Boolean flag = true; // 3
---------------------------
is not acceptable? Thanks a lot!
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
because:
Boolean flag = true
tries to assign the boolean literal true to a reference variable of type Boolean (which is a class)...
boolean flag = true
and
Boolean flag = new Boolean("true")
Boolean flag = new Boolean(true)
are valid statements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: errata or ??
 
Similar Threads
Boolean
Boolean doubt - simple
JLS..
simple question
Help...How much preparation do I need for SCJP1.4 ?