• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Other Modifiers for Members

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oliver............
the error is in Khalid's book ........why should he look in to errata written on RHE???
Harpal
 
Abhijit Natu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried the plugging the line
" final static trnasient float PI = 3.1415F;"
in a program and it works
without giving any compilation errors !!!
 
Run away! Run away! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic