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

What is Interface?

Answer Posted / tarun

In java Interface provides the definition of methods and
final variables. The variables can be declared as final or
not but its can not be changed or modified again. valiable
value can be decide only at the time of declaration.

for more clearance please go through the example given below.

// declaring an interface
public interface MyInterface {

public static final int y = 9;

public void service();
public int method();
public abstract void newmethod();

}

// implementing an interface by a class
public class Class1 implements MyInterface{

/**
* @param args
*/
public Class1(){
System.out.println(y);

}
public void service(){};
int i =9;


public int method(){
final int q = 10;

return q;
}

public void newmethod(){
System.out.println("Tarun");
}

public static void main(String[] args) {
// TODO Auto-generated method stub
Class1 c1 = new Class1();
}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What's the base class in java from which all classes are derived?

1266


What do you mean by constant time complexity?

1238


What is the full form of jpeg?

956


Name some classes present in java.util.regex package.

1029


What is the difference between class & structure?

1220


What are the basic interfaces of java collections framework?

1113


Is static a singleton?

973


Which list is sorted in java?

1030


What is output buffer?

1049


What is operator overloading. Is it is supported in java?

1028


What makes a function well defined?

987


What is purpose of find feature?

1078


Why declare Main() method as a static in java ?

1078


What is stored procedure. How do you create stored procedure ?

1951


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

972