Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

what is the output of this?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when you run it what does it say?
and here is an article all about your real question (string pools)

all about strings

and incase that wasn't what you were getting at:

avoid the equality operator
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The output when you feed this to the javac compiler would be: "Say what?!". Well actually it would be a whole bunch of errors.
If you fix those, though, the output of running this application would be...nah I don't want to spoil the surprise
Why don't you give fixing the syntax errors a try, and running the program?
If you then find yourself confused about the output you should read this.

Edit: Beaten by 22 seconds...
 
harshitha Venkat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jelle Klap wrote:The output when you feed this to the javac compiler would be: "Say what?!". Well actually it would be a whole bunch of errors.
If you fix those, though, the output of running this application would be...nah I don't want to spoil the surprise
Why don't you give fixing the syntax errors a try, and running the program?
If you then find yourself confused about the output you should read this.

Edit: Beaten by 22 seconds...


thank you so much for your reply this question was my interview question to which i was completely blank I really do not know the strings as am very new to this technology would thank you if you suggest me some good sites to learn java
 
harshitha Venkat
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:when you run it what does it say?
and here is an article all about your real question (string pools)

all about strings

and incase that wasn't what you were getting at:

avoid the equality operator



Hello thank you for the reply .This was my interview question
 
Ranch Hand
Posts: 32
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

A copy of TATA MC Graw Hill Sun Certified Java Certification 6 Book will make you learn all the concepts thoroughly .
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saket Kumar Sinha wrote:
A copy of TATA MC Graw Hill Sun Certified Java Certification 6 Book will make you learn all the concepts thoroughly .



but honestly who really needs to know if 2 string objects are equal? and interviews that ask you, avoid those jobs.
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saket Kumar Sinha wrote:
A copy of TATA MC Graw Hill Sun Certified Java Certification 6 Book will make you learn all the concepts thoroughly .



Dependign on how you use it, it might help you to understand Java better. However, I would guess that the way it's written and the way most people probably use it is to be able to pass the cert exam, which has very little to do with actually understanding Java.
 
Master Rancher
Posts: 4280
57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Wendy Gibbons wrote:but honestly who really needs to know if 2 string objects are equal? and interviews that ask you, avoid those jobs.


Well, I doubt they really need to know if two strings are equal. They are trying to find out if the candidate knows some Java fundamentals -- in in this case, the difference between equals() and ==. And if the candidate is in fact new to Java, it's not such an unreasonable question to ask. Presumably they've got a role that a Java beginner might be able to fill, but they want to assess how much of a beginner.
 
Marshal
Posts: 76468
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It may be a very simple starting question. A bit like the exercise about write a fizz‑buzz program. If you can’t answer something that simple, they know you ain’t going to get far with more difficult questions.
 
Are you okay? You look a little big. Maybe this tiny ad will help:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic