This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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 !!!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Other Modifiers for Members
 
Similar Threads
Can Static and Transient appear together?
Mughal Q4.26
Some basic questions - part 2
variable declaration
variable declaration