• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

(K&B),Doubt in implementation of abstract methods.

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii java guys.
Very gud morn..
i had doubt in the implementation of abstract methods.
In K&B book,it was written that,while implementing the abstract methods,we cannot put any nonaccess modifiers.
but when i try to use the nonaccess modifiers..it is compiling fine for all except static...
i want to confirm this one...
Thanks in advance.
 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you cannot have 'private abstract' methods, nor can the abstract class be private nor protected. You can, although, have 'protected abstract' methods, default, or public.

cheers, Marzo
 
Karthikeyan Balasubramanian
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiii friend,i am saying abt non-access modifier and not ACCESS MODIFIERS.
nON-ACCESS MODIFIERS LIKE synchronized,strictfp.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you cannot have an abstract synchronized method, it is an illegal combination, but you can have a abstract strictfp class.

i am still half asleep, it is still early where i am
 
Karthikeyan Balasubramanian
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No.......that's wat i am trying to say...
when i am going to use nonaccess modifiers except static,...it is compiling fine.
.
.
anybody tried it.
 
Marcelo Ortega
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried it and it gives me compiler error, illegal combination.
Maybe it's your compiler. Are you using an IDE or console?

It must be something with your compiler.

Cheers.
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, abstract methods cannot be private, static, final, native, synchronized.
 
Ranch Hand
Posts: 817
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but we can use strictfp, sycnronized while implementing it..

i have read this in K&B ...but not with abstract keyword
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic