• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is the keyword abstract and syncronized together allowed?

 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got this in one of the questions from whizlabs
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ankur kothari
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
illegal conbination of abstract and synchronized...thanks ankit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic