This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
    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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

How many String objects are created in the code

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Report post to moderator
How many string objects are created in the following code:-

1)2
2)4
3)8
4)9
im confuse that in System.out.println statement 2 objects r created or 1.
one more doubt.. if we put the code in the main method of a class will the object created be increase by 1 as the main method takes array of string as parameter.so the empty string.

thanks in advance
SCJP 1.4 in progress
Loveleen
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi Loveleen -

It appears you have posted this same question three times in two separate forums. We refer to this practice as 'cross-posting' and we discourage it on JavaRanch.

Please use one forum for a question. Do the best job you can to pick the proper one; if it can be better located a bartender or sheriff will assist.

Regards,

Michael
 
I want my playground back. Here, I'll give you this tiny ad for it:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!