Home Answers Viewqa Java-Beginners Use of Interfacecs in Java

 
 


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

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 Pages:
Java Use cases
Java Use cases  What are use cases
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
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 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
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
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
java use dll file - Java Beginners
java use dll file  how to execute dll file 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
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
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
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 of Java
Use of Java       What is the use of java? Java technology is a high-level programming and a platform independent language. Java
use of package concepts
use of package concepts  i m getting error when i use .* method to access all package files. when i use this through another method like... want to use packagename.* methhod. please solve the problem. i just start
How to Use Collections
How to Use Collections  how to use ArrayList and HashMaps in case of user defined class  Hi Friend, Please visit the following links.../index.shtml http://www.roseindia.net/java/beginners/array_list_demo.shtml
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.
use of plugins - Swing AWT
use of plugins  hi dear i m making a project on java swing .i needed a plugins for search buttons........  https://swingexplorer.dev.java.net/tips.html Thanks
how to use setAttribute
how to use setAttribute  how to get following codes using setAttributes in java??? Employee xlink:type="extended" xlink:show="new" xlink:actuate="onRequest
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 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 Apache POI?
How to use Apache POI?  Can anyone tell me how to use Apache POI??I...-scratchpad-3.2-FINAL-20081019.jar files into the following path: \Java\jdk1.7.0\lib \Java\jdk1.7.0\jre\lib \Java\jdk1.7.0\jre\lib\ext \Java\jre7\lib \Java\jre7\lib\ext
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
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
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 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 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
Use of setComment and getComment of ZipEntry.
Use of setComment and getComment of ZipEntry. In this tutorial, we will see the use of setComment and getComment method of ZipEntry  class. The ZipEntry...;} } Following is the output if you run the application: C:\>java ZipGetComment
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
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 use for loop in jsp
How to use 'for' loop in jsp page ? This is detailed java code that shows how to use 'for' loop in jsp page. 'if' statement is used to test conditions while... for the loop. In this example, we have developed use_for_loop.jsp page which shows
Can I use - Java Server Faces Questions
Can I use  Hi All, Can i use SelectOneMenu Tag in a dataTable Tag.I have coded like this.But It is not Working. Is it Correct.Ple
ABUT A FUNCTION AND ITS USE - Java Beginners
ABUT A FUNCTION AND ITS USE  SIR CAN U PLEASE TELL ME ABOUT parseInt(args[i]) a)its use? b)when it is used? C)is it related to string class
Use of Throwable Class
Use of Throwable Class Throwable class is the super class of all the exceptional class and error class. Only objects of this class can be thrown & caught and handled by try-catch blocks. In java you can throw exception Object which
Use of "descendant" in XPath expression
Use of "descendant" in XPath expression       In this section of XPath in Java tutorial you will learn use of descendant in XPath expression. "descendant"
Menubar and use <ul> <li> - Java Beginners
Menubar and use   I want to create a drop down menu with submenu, but have problem for one thing in IE, My button appear under the text of main menu. How can I bring it up? see the file at this address
What is use of method overloading and overriding?
What is use of method overloading and overriding?  Method overriding... write same method with different signatures.But I want to know what is the use of these concepts.how to use this type of polymorphism in real time? thanks
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
how to use a placeholders - JSP-Servlet
how to use a placeholders  dear sir, how to use and declare a place holder in java? i have to send the following mail Dear [Column 1... be fetch ,so how to use a place holder for this [column ] and also how to get
Use of Hyperlink in Swing - Swing AWT
is: Is it possible to use Hypelink in java Swing. Please Help. Regards...Use of Hyperlink in Swing  Hi, We are developing the UI using the Java Swing and I have to create Hyperlink in the JTable cell so that if the user
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
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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.