Two Laptop Bag
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "errata or ??" Watch "errata or ??" New topic

errata or ??

R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5376
que is from :
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

"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

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

[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

Joined: Aug 26, 2001
Posts: 7610
Boolean flag = true
tries to assign the boolean literal true to a reference variable of type Boolean (which is a class)...
boolean flag = true
Boolean flag = new Boolean("true")
Boolean flag = new Boolean(true)
are valid statements.
I agree. Here's the link:
subject: errata or ??
It's not a secret anymore!