This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interface Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Interface Question" Watch "Interface Question" New topic

Interface Question

Vidyavathi saravanan
Ranch Hand

Joined: Sep 24, 2004
Posts: 34

This is one of Dan's question. Answer given as ABCI.
My doubt is the inteface member s1 by default is 'public static final'. If that is the case, how come the subclasses are allowed to modify the variable s1. Please explain
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
The subclasses are not modifiying the static final variable I.s1, they are redefining it. Each of the classes A,B and C has its very own String variable s1.
[ October 20, 2004: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
I agree. Here's the link:
subject: Interface Question
Similar Threads
Object orientation
Q from Dan's exam
interface rule
Doubt in an Interface Question!!