javascript
Brief description  about Online courses   join in Online courses
View MAHANANDA  MUKUND 's Profile

interface as a datatype

I am not understanding the concept of interface as a data type please explain with a example
Asked by MAHANANDA MUKUND | Dec 16, 2010 |  Reply now
Replies (1)
View arun kumar das 's Profile
HI

understand this code and try yourself.


interface School {
void disply();

}

class SchoolDetails implements School {

public void disply() {
System.out.println("School Name: Ideal Higher Secondary School");

}

}

public class SchoolDisplay {
public static void example(School sc) {
sc.disply();

}

public static void main(String[] args) {
SchoolDetails details = new SchoolDetails();
example(details);

}

}


java Teacher
Dec 23, 2010