• 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
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Few queries on Chapter 3 of SCJP 5

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following are my queries with reference to Chapter 3 of SCJP 5

1. In the self test of Chapter 3 Question no 2
Should the answer not be 4 objects, since the line Cardboard c3 = c1.go(c2) would also set the c3 object to null.

2. Should the function rt.freeMemory() be rt.getFreeMemory()

Thanks
Deepak

On Page 234 of the book there is a typo System.out.println("y=" + i); should be System.out.println("y=" + y);
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. Have a look at the Errata for this book here...

https://coderanch.com/t/257589/java-programmer-SCJP/certification/SCJP-Errata-Updated
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by deepu verma:

1. In the self test of Chapter 3 Question no 2
Should the answer not be 4 objects, since the line Cardboard c3 = c1.go(c2) would also set the c3 object to null.



no, because c3 is just a reference variable in the stack, no object has ever been created for it to point to in the heap, hence nothing to be GCed.
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic