File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Other  Modifiers  for Members 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 "Other  Modifiers  for Members " Watch "Other  Modifiers  for Members " New topic
Author

Other Modifiers for Members

Abhijit Natu
Greenhorn

Joined: Oct 28, 2000
Posts: 4
Hi here's a question from Khalid-Mughal's book
page 130 Q4.26
Which of these are not Legal Declarations within a class
select all valid answers.
a) static int a;
b) final Object[] fudge ={null};
c) abstract int t;
d) native void sneeze();
e) final transient static private double PI = 3.14159265358979
I thought the answers were (c) & (e)
as
c) a variable can not be declared abstract
e) a varibale can not be both transient and static
but the book says the answer is (c) only
On page 126 there's note under the Transient Variables which also says that a varibale can not be both transient and static as static vars do not belong to the objects .
I am wondering if there is some mistake in the book or am I overlooking something !!!Please help ,
Abhijit.
Oliver Grass
Ranch Hand

Joined: Nov 02, 2000
Posts: 65
Originally posted by Abhijit Natu:
I am wondering if there is some mistake in the book or am I overlooking something !!!Please help ,
Abhijit.

Hi,
you're right, the book is wrong. Look at the errata for the RHE, they are writing, that the Note should be deleted....
hope that helps
Oliver
Harpal Singh
Ranch Hand

Joined: Oct 10, 2000
Posts: 229
Oliver............
the error is in Khalid's book ........why should he look in to errata written on RHE???
Harpal
Abhijit Natu
Greenhorn

Joined: Oct 28, 2000
Posts: 4
I tried the plugging the line
" final static trnasient float PI = 3.1415F;"
in a program and it works
without giving any compilation errors !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Other Modifiers for Members