Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

String class

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
nebody plz explain output of this program.
DO NOT POST REAL QUESTIONS
I removed this and all responses that could point to the question!!! Carl
Thanks,
Vinita
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the third step the process is ...removed....
selva.
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
vinita Kh
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so it means, whenever there is assignment ...removed....am i right?
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the methods like ....removed....never same as before
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Richard Selva
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this could be more clear to you .

Strings are ...removed...
selva.
[ May 03, 2002: Message edited by: Carl Trusiak ]
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vinita Kh:
so it means, whenever there is assignment....removed....


....removed....
And remember old object will be elligable for garbage collected if there is no referance to the old object.
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Steven Sun
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah,why i say

the methods like....removed....,


is just that when result has no difference with the primary one,no new object will create
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In other words, Line 1 to 4 will be output.

Clement
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Steven Wong
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Quote from Nazmul:
And remember ....removed....


The ....removed....
Clement
[ May 03, 2002: Message edited by: Carl Trusiak ]
 
Nazmul Huda Sarkar
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Clement Ng:

The garbage collection does not apply for String literals right? Cos String objects are not eligible for garbage collection.
Correct me if I am wrong.
Clement


May be you are right. I found in JWhizPlus: String s="Java"; s=null; Here the object will not be elligable for garbage collection.
But, String s = new String("Java"); s=null; here the object will be elligable for garbage collection.
[ April 30, 2002: Message edited by: Md. Nazmul Huda Sarkar ]
 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Clement Ng:

The garbage collection does not apply for String literals right? Cos String objects are not eligible for garbage collection.
Correct me if I am wrong.
Clement


Check out this thread for all you ever wanted to know about String literals and garbage collection.
Corey
 
Ranch Hand
Posts: 5397
1
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if that is not enough then
https://coderanch.com/t/236271/java-programmer-SCJP/certification/String-Pool-Redux
OR
https://coderanch.com/t/226960/java-programmer-SCJP/certification/Mack-GC
[ May 01, 2002: Message edited by: Ravish Kumar ]
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I took my exam yesterday and this question was in it, could the moderators please remove this post asap.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Our Policy on Real Questions is Clear We can not permit the discussion of Real Questions.
 
This tiny ad is guaranteed to be gluten free.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic