This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Mock Exam Errata and the fly likes abhilashs test 1 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 "abhilashs test 1 " Watch "abhilashs test 1 " New topic

abhilashs test 1

ramesh iyer

Joined: Feb 10, 2001
Posts: 12
Regarding the test at
test1. question 1 is
Read this piece of code carefully
if("String".toString() == "String")
System.out.println("Not Equal");

1.the code will compile an print "Equal".
2.the code will compile an print "Not Equal".
3.the code will cause a compiler error.
he says the answer is 1. but i get a compiler error. hence
i think it is answer 3.
Similar is the case with question 2 in that test.
Has anybody else taking this exam come up with something similar?

Lokesh Mahajan

Joined: Feb 01, 2001
Posts: 22
Hello Dear
No it is not throwing an error, you may have missed some thing,
how can it gives an will print "equal" because you have not created two different obj.had it been two different obj. created by means of an "new" in that case it would have printed "not equal".
just check it out by yourself.
ramesh iyer

Joined: Feb 10, 2001
Posts: 12
I am sorry lokesh. i apologize. i tried again and this time it works. Last time i must have goofed up elsewhere.
I agree. Here's the link:
subject: abhilashs test 1
It's not a secret anymore!