| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#1 (permalink) |
|
Senior Member
Join Date: Aug 2006
Age: 28
Posts: 275
Thanks: 0 Thanked 5 Times in 5 Posts Thanks: 0
Thanked 5 Times in 5 Posts
Rep Power: 5
|
INTERFACE QUESTION.
Q.) Interfaces are syntactically similar to classes,But they lack to Instance Variables. This means that, Interface does not have variables.Then How Interface uses Variables?
|
|
|
|
|
|
#2 (permalink) |
|
Super Moderator
Join Date: Feb 2006
Location: Hyderabad
Posts: 2,355
Thanks: 117 Thanked 241 Times in 198 Posts Thanks: 117
Thanked 241 Times in 198 Posts
Blog Entries: 4
Rep Power: 51
|
Re: INTERFACE QUESTION.
Radhika,
You can have variables within interfaces. By default, they are FINAL STATIC variables. Thanks, Krishna |
|
|
|
|
|
#3 (permalink) |
|
Member
Join Date: Jan 2007
Posts: 32
Thanks: 3 Thanked 3 Times in 3 Posts Thanks: 3
Thanked 3 Times in 3 Posts
Rep Power: 2
|
Re: INTERFACE QUESTION.
Radhika,
As kireeti said the Inteface can have variables. Those are Final and static by default it is right. I think it might be useful info on this one thing is Interface and class are similar in structure the only difference is that the interface can't have implementation for the methods where as the class can have. You can use the Interface variables like static variables of a class for example in jdbc while creating the statement we will use the properties to get the statment type there we will use the ResultSet.CONCUR_READ_ONLY along the TRANSACTION_READ_COMMIT , etc.
__________________
Cheers, Laxmi |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JAVA Q&A part1 | naga | JAVA Technologies | 2 | 27-04-07 12:53 PM |
| TATA ELAXSI placement paper 2 | sridhar | TATA ELXSI Placement Papers | 0 | 12-02-07 04:10 PM |
| Abstract Classes versus Interfaces? | radhika743 | JAVA Technologies | 5 | 16-01-07 07:54 PM |
| Interview questions you may be asked | yathish | HR Questions | 6 | 24-12-06 08:35 PM |
| JAVA collection | naga | JAVA Technologies | 0 | 21-02-06 06:01 AM |