Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method in interface?

 
jordan gong
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Helper:
Can the methods in interface be synchronized?
Can private method be overriden?
Can transient variable be written to output files?
Thanks.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jordan,
Yes methods defined in interfaces can be synchronized. Since each class that implements the method will be required to handle it accordingly.
No, private methods can not be overridden because they are not visible by any other class (including subclasses).
Yes, transient variables can be written to output files. JLS only specifies that transient variables will not be serialized when the class is serialized.
Regards,
Manfred.
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jordan,
I'm going to move this to Certification Study. This forum is only for reporting possible mock exam errors.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic