• 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

Question from http://www.danchisholm.net

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 17
Which of the following modifiers can not be used with the abstract modifier in a method declaration?
a. final
b. private
c. protected
d. public
e. static
f. synchronized
g. native

Can any body Help Me. ???
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
only protected and public modifiers can be used with abstract modifier for methods.
 
deepu Bhalotia
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ohh... I took it as can be... But in the Question it is given as 'can't be'.

Anyway
Thanks,
Haran
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

we cannot use "final" modifier withh "abstract", bcoz both the concepts are contradictory. As u can c if u want 2 use final u cant subclass or override, but in case of abstract we have to override.

hope it will clear ur doubt. buzz me again if u want.

with regards,
Renato(chetty)
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone please post the exact answer to this question.I am wondering whats the rite answer???I think we can use public,protected,synchronized and native while we cannot use private,final and static.I am no geek..so waitin for the rite answer.
Thanks
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
we can't use the following modifiers in comb. with abstract:
1) static
2) final
3) synchronized
4) native
5)private ( can be used with abstract when defining a member class)

thanx
amit
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Which of the following modifiers can not be used with the abstract modifier in a method declaration?
a. final
b. private
c. protected
d. public
e. static
f. synchronized
g. native



You cannot use these modifiers because...

1. final: ...an abstract method has to be implemented, so, declaring it final is pointless and contradictory; final means complete, abstract means incomplete.
2. static: ...the static methods are not inherited and therefore you cannot override a static method, you can hide it, but not override it, so once again it would be pointless.
3. synchronized and native: ...these modifieres are implementation specific. You can override an abstract method using this modifiers, but it does not make any sense to declare a abstract method syncrhonized or native, because you have not provided an implementation for the method yet.
4. private: ...you cannot declare a mehtod abstract and private at the same time, because a private method cannot be inherited and therefore cannot be implemented.
[ April 27, 2005: Message edited by: Edwin Dalorzo ]
 
deepu Bhalotia
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys...

Thanks
Deepak
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic