Use of Interfacecs in Java

Use of Interfacecs in Java

What is the use of Interfaces in Java?

View Answers

February 26, 2008 at 10:58 AM

Uses of Interface

Interfaces encodes similar types of classes that shares various resources but do not necessarily constitute a class relationship. For example, a human and a parrot both can whistle, it doesn?t mean that we should kept Humans and Parrots as subclasses of a Whistler class, rather they would most likely be subclasses of an Animal class (likely with intermediate classes), but would both implement the Whistler interface.

Interfaces can also be used to use an object without knowing its type of class, but rather only that it implements a certain interface. For example, if one were annoyed by a whistling noise, while another may not know whether it is a human or a parrot all that could be determined is that a whistler is whistling. Calling whistler.whistle() calls the implemented method whistle of object whistler no matter what class it has, provided it implements Whistler.]

Thanks
Regards Roseindia


February 26, 2008 at 11:22 AM

Hi Abhilash

Here you can read the use of Interfacecs.

http://www.roseindia.net/java/master-java/interface.shtml

Regards
Neelam ;)









Related Tutorials/Questions & Answers:
Java - Java Beginners
Use of Interfacecs in Java  What is the use of Interfaces in Java...;Hi Abhilash Here you can read the use of Interfacecs. http... to use an object without knowing its type of class, but rather only
Java Use cases
Java Use cases  What are use cases
Advertisements
What is the use of Java?
What is the use of Java?  Hi, What is the use of Java programming Language? How Java is useful for creating applications? Thanks   Java.... You can check more details at What is the use of java?. Thanks
java use dll file - Java Beginners
java use dll file  how to execute dll file in java
making use java image filters
making use java image filters  while making use any functions built in jerry's filter in java application i get a NullPointerException.. I dont know the reason for this.. please give me a solution
What is Java?
What is the use of Java
How to use charAt() method in Java?
How to use charAt() method in Java?  Hi, what is the correct way of using chatAt() method in Java? Thanks   The charAt() method in Java... at charAt() Method In Java. Thanks
list of predeined methods and use java
list of predeined methods and use java  I need list of predefined methods in java like reverse,compare,tostring, etc
How to create and use Array in Java?
How to create and use Array in Java?  Hi, How to create and use Array in Java? Write program to construct and use the array. Thanks   Hi... can read complete example at Array in Java. Thanks
why we use constructors instead of methods in java?
why we use constructors instead of methods in java?   why we use constructors instead of methods in java
how to use marathi keyboard in java programming?
how to use marathi keyboard in java programming?  how to use Marathi keyboard in java programming
What is the real use of Java Program
What is the real use of Java Program  Hi, I am complete beginner in programming. I want to learn Java and other programming technologies. I want to know more in Java programming. What is the real use of java program? Just
What is the real use of Java Program
What is the real use of Java Program  Hi, I am complete beginner in programming. I want to learn Java and other programming technologies. I want to know more in Java programming. What is the real use of java program? Just
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
is it possible to use jsp in java script
is it possible to use jsp in java script  is it possible to use jsp inside the javascript while using java script in body tag on that time i am calculate number of records in mysql, so that i am using jsp.if count value
What is the use of Hibernate Framework in Java
What is the use of Hibernate Framework in Java  Hi, What is the use of Hibernate Framework in Java? When to use Hibernate framework in a Java... is the use of Hibernate Framework in Java? Hibernate framework is used in Java
How to use Java Beans in JSP?
How to use Java Beans in JSP?  Hi, I have developed a employee bean in Java: public class Employee{ private String name; private String code; ..... } Please tell me how I can use Employee Java bean in JSP page? Thanks
why we use abstract class in java?
why we use abstract class in java?  what is the the purpose of abstract class.Give example when to use abstract and when use interface
Java PrintStream significance and where to use this?
Java PrintStream significance and where to use this?  I found many programmers using PrintStream in their codes. I looked for this,but failed to get the clear idea of its significance,Why to use it? "Unlike other output streams
Use of wrapper objects - Java Interview Questions
Use of wrapper objects  What is the role & use of Java wrapper objects?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/wrapper-class/ Thanks
How to use this keyword in java
How to use "this" keyword in java   ... use this keyword. Here, this section provides you an example with the complete... to use it. In the example, this.length and this.breadth refers to the instance
Use of isReadOnly() method in java.
Use of isReadOnly() method in java. In this tutorial, we will see how to use of isReadOnly method in java. IntBuffer API : The java.nio.IntBuffer class...;} } Output C:\r>java BufferIsReadOnly Content in int buffer. 2
use of synchronozation - Java Interview Questions
use of synchronozation  once compare arraylist and vector,arraylist... visit to : http://www.roseindia.net/java/thread/synchronization.shtml http://www.roseindia.net/java/java-methods/java-method-synchronized.shtml http
Use Java Bean In Servlets
Use Java Bean In Servlets In this you will learn how to use Java Bean in Servlets. For this purpose, we have created a Bean named 'Person' and defined three variables with their setters and getters. Then we have created an object
Use of rewind method in java.
Use of rewind method in java.       In this tutorial, we will explain the use of rewind() method of Buffer class. The ByteBuffer ...: C:\>java ByteBufferRewind Without rewind the content of buffer
Use of Java
Use of Java       In this section you will learn about the Use of Java... is the use of java? Java technology is a high-level programming
How to use find method in Java - Java Beginners
How to use find method in Java  Hello, I want to write a class that gets a web page, parses it, and tries to find an object with certain... class, then somehow parse through the class's objects/sub-objects, and use find
Use of assert keyword in Java - Java Beginners
Use of assert keyword in Java  Hi, What is the purpose of assert keyword used in JDK? Thanks   Hi Friend, It is used to validate...://www.roseindia.net/javatutorials/use-assertion-in-java.shtml Thanks
Which java collection to use in scenario below and Why?
Which java collection to use in scenario below and Why?  I want to store thousands of record in a collection and later I want to search. For best and optimized results, which collection will I prefer
Confermation for use of API - Java Beginners
Confermation for use of API  HI ! I am new here. I am making an application for wireless communication between mobile and pc. Let me know which api I have to use at J2SE side. I will be very thankful to you. Regards
how to use foreign key in java
how to use foreign key in java  I have two tables in my MySQL database, which were created like this: CREATE TABLE table1 ( id int auto_increment, first name varchar(10), primary key(id) ) CREATE TABLE table2 ( id_fk int, last
how to use Excel Templet to write excel file using java.
how to use Excel Templet to write excel file using java.  how to use Excel Templet to write excel file using java
how to use views - Java Beginners
how to use views  how do i retrive data from a database and display it gui  Hi Friend, We have retrieved the value from the database and show it in Swing table. import javax.swing.*; import javax.swing.table.
how to use update - Java Beginners
how to use update  Hi all, your all code is perfect thanks. I have one table emp ID,emp name,view,modify and delete. emp_ide_name have taken from database but view modify and delete is link if user click modify data
create and use an array variable in a java program
create and use an array variable in a java program  how do i write a program that will prompt the user for a list of 5 prices, once the user has entered all values , your program should compute and display the following: The sum
why we use design patterns in java?Example?
why we use design patterns in java?Example?  Hi..... Why we use design patterns?,why they are needed in programming languages?,advantages?   hi friend, please go through the following links may this will be helpful
how to make use of jerry's java image processing filter in java application?is there anyway to do this?
how to make use of jerry's java image processing filter in java application?is there anyway to do this?   how to make use of jerry's java image processing filter in java application?is there anyway to do
how to use Excel Template to write excel file using java
how to use Excel Template to write excel file using java  How to use Excel template to write data in that file using java
when to use ArrayList and when to use HashMap - Java Interview Questions
when to use ArrayList and when to use HashMap  when to use ArrayList and when to use HashMap in web applications . Thanks Prakash  When your application demands saving the objects then ArrayList can be used
How to use regular expressions - Java Beginners
How to use regular expressions  how do i put a label and text field... in Java Swing to put label and text field on a frame. // LabelTextSwing.java... Friend, Here i am sending you full source code in Java Swing to put label
Meaning Of annatations and use - Java Interview Questions
Meaning Of annatations and use  Hi all use of Annatations and exat... are there in java. * Marker: Like the marker interface, marker annotations... or we can use the shortcut syntax (just by using the value only within
adding data to the database with the use of jtable - Java Beginners
adding data to the database with the use of jtable  how can i add data to the database with the use of jtable. and also can able to view the records in the database in the table.. tnx :G
adding data to the database with the use of jtable - Java Beginners
adding data to the database with the use of jtable  how can i add data to the database with the use of jtable. and also can able to view the records in the database in the table.. tnx :G
Example for when to use ArrayList and when to use HashMap - Java Interview Questions
Example for when to use ArrayList and when to use HashMap  Hi Deepak u have replied this answer for when to use arraylist and hashmap " When your application demands saving the objects then ArrayList can be used. But if you need
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers
Use a tree stack to sort number in java?
Use a tree stack to sort number in java?  The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers

Ads