Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Use of Interfacecs in Java
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Abhilash
Use of Interfacecs in Java
2 Answer(s)      6 years and 9 months ago
Posted in : Java Beginners


What is the use of Interfaces in Java?


Advertisement
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 Use cases
Java Use cases  What are use cases
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
Advertisements
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
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 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
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
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
java use dll file - Java Beginners
java use dll file  how to execute dll file in java
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
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
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... C:\r>java BufferIsReadOnly Content in int buffer. 2 Buffer
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 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
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
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
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 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
how to use marathi keyboard in java programming?
how to use marathi keyboard in java programming?  how to use Marathi keyboard in java programming
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
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
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
Use of Java
Use of Java       In this section you will learn about the Use of Java.... Here are the Uses of Java What is the use of java
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 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
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
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
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
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
 

 

 

DMCA.com