aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes is the keyword abstract and syncronized together allowed? 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 "is the keyword abstract and syncronized together allowed?" Watch "is the keyword abstract and syncronized together allowed?" New topic
Author

is the keyword abstract and syncronized together allowed?

Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
i got this in one of the questions from whizlabs
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

1. Did you try it yourself??
2. Since an abstract method doesn't have any body, so it doesn't need any thread safety. And a synchronized method can override a non-synchronized method i.e. if an abstract method calculate is not synchronized, then the concrete implementation can be synchronized...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
i didnt try it....i wanted to know the reason why they are not allowed together...i will try it now
Ankur kothari
Ranch Hand

Joined: Sep 06, 2009
Posts: 531
illegal conbination of abstract and synchronized...thanks ankit
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: is the keyword abstract and syncronized together allowed?