Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

"we cannot create an object of interface but we can create
a variable of it".diacuss the statement with the help of
an example.

Answer Posted / ami singh

yes we can create a variable in inerface
and i will be constant
mans to say that hey will be static and final
inerface Xyz
{
public static final i = 12;
public static final j = 20;
}
class Amit implements Xyz
{
psvm(String [] args)
{
Xyz k = new Amit();
System.out.println("value of var1 " + k.i);
Sysem.out.prinln("value ofd var 2 " + k.j);
}
}
Thanks ami singh
(amitsing2008@gmail.com)

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the vector class in java programming?

1004


What do you mean by multithreaded program?

960


Why can't you declare a class as protected?

1049


What is the difference between synchronized and synchronized block?

1006


What is definition and declaration?

964


What are some examples of variable costs?

892


What does provide mean construction?

1051


What is the base class for error and exception?

947


How to create a fecelet view?

944


What makes a function well defined?

937


Does java support multiple inheritances?

965


Can you extend main method in java?

1093


What is null in java?

906


Can a constructor be protected?

1028


Is arraylist zero based?

1005