aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Transient & Static Variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Transient & Static Variables" Watch "Transient & Static Variables" New topic
Author

Transient & Static Variables

viyer
Greenhorn

Joined: Oct 05, 2000
Posts: 2
Khalid's book states:Pg126
Transient modifier should not be specified for static variables as these do not belong to objects
But later in the problem 4.26 Pg 130
Is this legal declaration?
final transient static private double PI = 3.141592
The answer is true.
Can someone please explain?
thanks
veena
bill bozeman
Ranch Hand

Joined: Jun 30, 2000
Posts: 1070
Check out this link a little further down this forum:
http://www.javaranch.com/ubb/Forum24/HTML/004765.html
Transient class can be declared as static and final. RHE reported this wrong and corrected it on the errata sheet.
Bill
Kishan Kumar
Ranch Hand

Joined: Sep 26, 2000
Posts: 130
Bill,
I would like to correct a small error, transient cannot be
applied to a class or a method, it can only be applied to
variables.
read the line
" Transient class can be declared as static and final. RHE reported this wrong and corrected it on the errata sheet "
which you had written.
------------------
Regards,
V. Kishan Kumar


Regards,<BR>V. Kishan Kumar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transient & Static Variables