Home Answers Viewqa Java-Interview-Questions Java and Collection Interfaces

 
 


Kalaiselvi.M
Java and Collection Interfaces
1 Answer(s)      5 years and 3 months ago
Posted in : Java Interview Questions

I wanted to know more about Java and Collection Interfaces

View Answers

February 27, 2008 at 4:06 PM


Java and Collection Interfaces

Interface : Types of Interfaces

Interface ,simply say something to a media by using another media. For example TV Remote is an interface because it is medium for giving the command to a TV for changing the channels or to ON/OFF the TV.

Interface is nothing , the collection of methods with empty implementations and constants variables .All the variables declarations are static and final. All the methods in an interface are "public and abstract" by default. Interfaces are abstract in nature so they can not be directly instantiated.For defining the methods of an interface use the keyword "Implements ".Interfaces are just like the abstract classes but the major difference between these two is that interface contains all the methods abstract while abstract classes must have at least one abstract method.

Interface Definition

access specifier interface(keyword) interfacename{

constant variable declarations ;

abstract methods declarations ;

}

For Example

interface Firstinterface // use keyword interface & interfacename
{
int a=100; // by default contant variable

}
interface Secondinterface extends Firstinterface // for accessing the functionality of Firstinterface use extends keyword
{
int b=200;
int sum = a+b;
void Display();
}
class Interfaceclass implements Secondinterface // for using the functionality of Firstinterface & Secondinterface use the keyword implements
{
public void Display()
{
System.out.println(sum);
}
public static void main(String[] args)
{
Interfaceclass temp = new Interfaceclass();

temp.Display();
}
}

In Java there is no types of the interfaces . In collection we have three interfaces such as :-

(1) List interface

(2) Set interface

(3) HashMap interface


Neetu ;)









Related Pages:
Collection Interfaces
Collection Interfaces     .... The following diagrams shows the framework of core collection interfaces hierarchy. Table of the ordered and unordered Collection interfaces shown
Collection Interface
Java NotesCollection Interface The Collection interface is the parent of the List and Set interfaces, but not Map. Assume the following declaration for identifiers in the table below: Collection coll; boolean b; Object obj; int i
Collection Interface
Java NotesCollection Interface The Collection interface is the parent of the List and Set interfaces, but not Map. Assume the following declaration for identifiers in the table below: Collection coll; boolean b; Object obj; int i
collection
collection  As we know array holds the similar kind of elements, then in collection how toArray() method will convert the collection having different objects as elements to an array in java
Collection
Collection  i need a collections examples   Please visit the following links: http://www.roseindia.net/javacodeexamples/index.shtml http://www.devmanuals.com/tutorials/java/collections
Java interfaces
Java interfaces  What interface must an object implement before it can be written to a stream as an object
java interfaces
java interfaces  sample code for multiple interface   interface A { void test(int i); } interface B { void test(String s); } public class MultipleInterface implements A, B { public void test(int i
Java Collection API - Java Tutorials
Java Collection API Collection was added to Java with J2SE 1.2 release... of the collection interfaces. Also, they are reusable data structures. Algorithms... and sorting, on objects that implement collection interfaces. The same method can
Custom Collection Implementations
the Java  built-in Collection Interfaces implementations. Apart from these, some times programmer need to implement their own collections classes.  The Java... Custom Collection Implementations  
Marker interfaces in java
Marker interfaces in java  how marker interfaces work
asynchronous and synchronous collection
asynchronous and synchronous collection  which are all interfaces or classes are synchronous and asynchronous in java? please send it in table or picture form
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces. eg: ---- interface i1
java interfaces implementation
java interfaces implementation  hai I have defined one inter face like Maths taking methods like add(), sub(), mul()in interface I take different implementation classes for add() method and sub()and mul() when i trying
Java Collection
Java Collection  What is the Collection interface
Interfaces - Java Interview Questions
Interfaces  two interfaces having same method names and these two interfaces are implemented by a single class. so now i would like to generate different code of same methods of different interfaces in single class? my query
how to create interfaces in java
how to create interfaces in java  HI, Here is my code public interface validateInfo { public void validate(String empcode, String password); } class updateInfo implements validateInfo { public void update() { //code
Collection to Array
; interface is a member of the Java Collection Framework and extends Collection... Collection to Array      ...; a collection into a array. In this example we creating an object of ArrayList, adding
interfaces - Java Beginners
, super class constructor runs.what about interfaces?  Hi Friend... is called the base class or the parent class. To derive a class in java the keyword... to : http://www.roseindia.net/java/language/inheritance.shtml Thanks
interfaces - Java Beginners
interfaces  examples on interfaces  Hi Friend, Please visit the following links: http://www.roseindia.net/java/master-java/interface.shtml http://www.roseindia.net/java/java-exception/create-interface.shtml
Collection in java
Collection in java  What are the meaning of the letters E,T,K and V that come in the collection concept
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection
Collection framework
Collection framework  what are the real life examples of using Collection in java
Introduction to collection Implementations
the collection interfaces.  Implementations are also responsible for documenting... Introduction to collection Implementations  ...-designed set of interfaces and classes used for storing and manipulating groups
Summary: Classes, Interfaces
Java: Summary: Classes, Interfaces Packages package package-name; Class Definition A class definition prototype: visibility class class-name [extends parent-class] [implements interface-name...] { class-body } nameMeaning
interfaces
& interfaces.   An interface declaration introduces a new reference type whose members are classes, interfaces, constants and abstract methods... to directly implement one or more interfaces, meaning that any instance of the class
interfaces,exceptions,threads
interfaces,exceptions,threads  SIR,IAM JAVA BEGINER,I WANT KNOW THE COMPLETE CONEPTS OF INTERFACES,EXCEPTIONS,THREADS   Interface... class. In java, multiple inheritance is achieved by using the interface
Implementation code inside interfaces
Implementation code inside interfaces 2001-01-25 The Java Specialists' Newsletter [Issue 006] - Implementation code inside interfaces Author: Dr. Heinz... email or RSS. Welcome to the 6th issue of "The Java(tm) Specialists
Jaca Collection
Jaca Collection  does Java collection allow incompatible types to be stored in single collection
EJB Interfaces
EJB Interfaces       Interface in java means a group of related methods with empty bodies. EJB have generally 4 interfaces. These are as follows 1)Remote interface:- Remote interface
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections
Java Collection
Java Collection  What are Vector, Hashtable, LinkedList and Enumeration
garbage collection
garbage collection  how to use garbage collection in program using core java
Garbage collection
Garbage collection  why garbage collection? How it works?   Garbage collection is one of the most important features of Java. The purpose... collection is also called automatic memory management. In Java, it is good idea
Interfaces and Abstract Classes - Development process
Interfaces and Abstract Classes  What are the Scenarios where we use Interface and Abstract Classes?  Hi Friend, Interface: Java does... by using the interface. Interfaces are useful when you do not want classes
Collection of Large Number of Java Sample Programs and Tutorials
Collection of Large Number of Java Sample Programs and Tutorials Java Collection Examples Java 6.0 New Features (Collection Framework... will read the advantages and disadvantages of Java Collection Framework
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
Collection of Large Number of Java Interview Questions!
What are null or Marker interfaces in Java... listed the Java Questions which are commonly asked. Our collection... interfaces for web based Java applications.     JSF Interview
garbage collection in java
.style1 { color: #FFFFFF; } Garbage Collection in Java In java...;  C:\unique>java GarbageCollector Garbage Collection... are destroyed for later reallocation of their memory. In java this is done automatically
Collection classes in java
is the reason using java collection classes saved/stored the data/content.I don't understand, what is the idea using java collection classes in project. Or the data is stored in both database and java collection classes
Collection classes in java
is the reason using java collection classes saved/stored the data/content.I don't understand, what is the idea using java collection classes in project. Or the data is stored in both database and java collection classes
Collection Framework - Java Beginners
Collection Framework  Pls explain the disadvantages of using collection framework as it was written in this forum ? It must cast to correct type. ? Cannot do compile time checking. I couldnot get in detail as to what
collection - Framework
://www.roseindia.net/java
Java API
Java API       Java API Java API is not but a set of classes and interfaces that comes with the JDK. Java API is actually a huge collection of library
Java collection -Hashtable
Java collection -Hashtable   What is Hashtable in java collection?   Java collection -Hashtable;- The hashtable is used to store value in the form of map key with value. import java.util.Hashtable; import
Java collection-LinkedList
Java collection-LinkedList  How to use java collection-linked list ?   Example: import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class LinkedListExample{ public static void
garbage collection - Java Beginners
of memory.It identifies the objects that are no longer used by a program. A Java object is subject to garbage collection when it becomes unreachable to the program..."algorithms.Instead of "destructor" in c++ , java supports garbage collector
Java collection Queue Example
Java collection Queue Example  How can we use Queue in java collection?   import java.util.LinkedList; import java.util.Queue; public... LinkedList(); queue.add("Java"); queue.add("DotNet
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
Java collection LinkedHashSet
Java collection LinkedHashSet  How can we use LinkedHashSet in java collection?   import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Set; public class LinkedHashSetExample{ public static

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.