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...

can we create instance for interface in java?

Answer Posted / guru

interface call2
{


void get1();
int a=8;
}


interface call extends call2
{


void get();

}



class interex implements call,call2
{

public void get()
{

System.out.println("hi");

}
public void get1()
{System.out.println("hsfwsi");}
}


class interex1
{
public static void main(String s[])
{
call e=new interex1();



e.get();
e.get1();

System.out.println(e.a);
}
}

second pgm
-----------
interface call2
{


void get1();
int a=8;
}


interface call extends call2
{


void get();

}



class interex implements call,call2
{

public void get()
{

System.out.println("hi");

}
public void get1()
{System.out.println("hsfwsi");}
}


class interex1
{
public static void main(String s[])
{
call e=new interex();



e.get();
e.get1();

System.out.println(e.a);
}
}

Is This Answer Correct ?    14 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to change the priority of thread or how to set priority of thread?

1011


What purpose do the keywords final, finally, and finalize fulfill?

1080


What is contractor means and methods?

979


How we can make copy of a java object?

1075


What is replaceall in java?

998


How to print an arraylist in java?

1055


What is jvm? Why is java called the platform independent programming language?

999


What is a java string?

1051


What are the 5 types of research methods?

1133


Explain the significance of class loaders in bootstrap?

925


How a string is stored in memory?

989


What is the purpose of interface?

986


Can we have this () and super () together?

1024


What will happen if a thrown exception is not handled?

995


how to split string in java?

1194