• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

abhilashs test 1

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Regarding the test at http://www.angelfire.com/or/abhilash/Main.html
test1. question 1 is
------------------------------------------------
Read this piece of code carefully
if("String".toString() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");
Answers

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?
Regards
Ramesh
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Dear
No it is not throwing an error, you may have missed some thing,
how can it gives an error.it 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.
lokesh
 
ramesh iyer
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry lokesh. i apologize. i tried again and this time it works. Last time i must have goofed up elsewhere.
Regards
Ramesh
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic