core java collection package

core java collection package

View Answers

September 4, 2008 at 6:15 PM

Hi friend,

Primitive data types :
* byte
* short
* int
* long
* float
* double
* boolean
* char

They are not objects according to the compiler, it cannot treat like objects.
You cannot extend from the class int because it does not exist.
Object-oriented programmers not accept. Everything must be an object.
So, Java includes wrapper classes which convert the primitive data types into real Java Objects.
There is no class in Java called int but there is a class called Integer.
Java is case-sensitive, so Integer does not equal int.

Java provides the Collections Framework. In the Collection Framework,
a collection represents the group of the objects.so,primitive data not treat as Object.
It cannot store in Collection and after wrapper the primitive data types store in the Collection.

For example :

import java.util.*;

class collectionExample
{
public static void main(String[] args)
{
int i=1;
ArrayList al =new ArrayList();
al.add(new Integer(i)); // wrapper the int "i".
System.out.println("ArrayList : " + al);
}
}

For read more on Collection to visit the link....

http://www.roseindia.net/java/example/java/util/

Thanks









Related Tutorials/Questions & Answers:
core java collection package - Java Interview Questions
core java collection package  why collection package doesnot handle..., Java includes wrapper classes which convert the primitive data types into real Java Objects. There is no class in Java called int but there is a class called
java core collection - Java Interview Questions
java core collection  why program in collection package throw two warnings(notes
Advertisements
Java Collection
Java Collection  What is the Collection interface
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection
Collection in java
Collection in java  What are the meaning of the letters E,T,K and V that come in the collection concept
Filter collection in Java 8
Filter collection in Java 8  Hi, I have following collection..., Example of Filter collection in Java 8 You can use the following code in Java 8... the data not containing "Java". Thanks   Hi, We have huge collection
Java Package
Java Package       In a computer terminology, package is a collection of the related files in the same... to use them in an easier way. In the same manner, Java package is a group
Java Collection
Java Collection  What are Vector, Hashtable, LinkedList and Enumeration
Java collection
Java collection  What is relation between map and set
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections
java collection
java collection  how do I use a treeset to print unique words
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
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
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
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
Java Collection API - Java Tutorials
Java Collection API Collection was added to Java with J2SE 1.2 release. Collection framework is provided in 'java.util.package'. All collections... implementations of the collection interfaces. Also, they are reusable data structures
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
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
Java package
Java package  Which package is always imported by default
Collection
Collection  What is the exact difference between lagacy classes and collection classes? and Enumeration is possible on Collection classes
How to convert Collection to Array in Java?
How to convert Collection to Array in Java?  Hello, I have a collection object in data with data in it. How to convert Collection to Array in Java... to Array in Java. Here is the code for converting Collection to Array: String
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
Java Collection-TreeSet
Java Collection-TreeSet  What is TreeSet in Java Collection?   Example: import java.util.Iterator; import java.util.TreeSet; public class TreeSetExample{ public static void main(String [] args
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
Java collection Stack example
Java collection Stack example  How to use Stack class in java collection?   The Stack class uses the First In Last Out(FILO) mechanism... :- -1 Description:- The above example demonstrates you the Stack class in java
Java collection HashSet
Java collection HashSet  How can we use HashSet in java program?   The hashSet class is used to create a collection and store it in a hash table. Each collection refer to a unique value. import java.util.Collections
Java collection Vector
Java collection Vector  How can we use the vector class in java program?   The vector class is similar to the ArrayList class except that the vector class is synchronized. import java.util.Iterator; import
What is garbage collection? - Java Beginners
. How garbage collection works in java? Thanks   Garbage Collection in Java In Java when program executes the JVM creates the object... in Java. Check the garbage collection code at http://www.roseindia.net/answers
Java package
Java package  What restrictions are placed on the location of a package statement within a source code file
java collection - Development process
java collection - creating and comparing lists using Java  How to compare two list in java? and i have to create two more list from old two list. Comparing and Creating new list in Java Java Example code for creating
collection
, Hashtable and Collections and Collection?   Enumeration : It is series... : It is re-sizable array implementation. Belongs to 'List' group in collection... Map in collection. Collections : It implements Polymorphic algorithms which
Java HashSet Collection problem
Java HashSet Collection problem  Here's how the HashSet works. It maintains an array of buckets. When an object is inserted, it finds the appropriate bucket corresponding to the objects HashCode. Then it calls the equals method
Java Collection iterator with example
The Java Collection Iterator is present at the highest level interface in the Collection framework. Iterator interface has methods for traversing.... Example of Java Collection Iterator import java.util.ArrayList; import
Java collection HashSet and TreeSet
Java collection HashSet and TreeSet   How can we used HashSet and TreeSet in the both Example?   import java.util.HashSet; import java.util.Set; import java.util.TreeSet; public class SetsExample{ public static
Collection
Collection  actually why do we need collections? means we can also store group of objects in relational data base and dbms also provides all the operatoins insert,delete,update,sort,search etc. then why collection
package in java
package in java  when i run a package it give a error exception in thread "main" java.lang.NoClassDefFoundError what i do
Collection of Large Number of Java Interview Questions!
. The Core Java Interview Questions More interview questions on core Java.. Read these interview questions to improve your core Java
java collection - Java Beginners
java collection  want a java program using collections for an algorithm the algorithm is give below algorithm has some transactions T1=ABCE T2=CDE T3=DE T4=CDEG T5=BG T6=AE T7=BCG T8=C T9=A now compare T9
What is the best way to filter a Java Collection?
is using Java 8. Thanks   Hi, We have huge collection of Java util package...What is the best way to filter a Java Collection?  Hi, I have... to filter a Java Collection? Thanks   Hi, In Java 8 you can use
Java package,Java Packages
Packages in Core Java Package Description... Java Package       Introduction to Java Package A Java package is a mechanism for organizing a group
Java garbage collection
Java garbage collection  Can an unreachable object become reachable again
Java garbage collection
Java garbage collection  How many times may an object's finalize() method be invoked by the garbage collector
Java garbage collection
Java garbage collection  Can an object be garbage collected while it is still reachable
Maven dependency for io.streamnative - pulsar-package-core version 2.8.0-rc-202105092228 is released. Learn to use pulsar-package-core version 2.8.0-rc-202105092228 in Maven based Java projects
( io.streamnative - pulsar-package-core version 2.8.0-rc-202105092228 ) in their Java...; io.streamnative - pulsar-package-core version 2.8.0-rc-202105092228 in Java...-package-core version 2.8.0-rc-202105092228 java library in your project. Now
Maven dependency for io.streamnative - pulsar-package-core version 2.8.0-rc-202105130910 is released. Learn to use pulsar-package-core version 2.8.0-rc-202105130910 in Maven based Java projects
( io.streamnative - pulsar-package-core version 2.8.0-rc-202105130910 ) in their Java...; io.streamnative - pulsar-package-core version 2.8.0-rc-202105130910 in Java...-package-core version 2.8.0-rc-202105130910 java library in your project. Now
Maven dependency for io.streamnative - pulsar-package-core version 2.8.0-rc-202105170207 is released. Learn to use pulsar-package-core version 2.8.0-rc-202105170207 in Maven based Java projects
( io.streamnative - pulsar-package-core version 2.8.0-rc-202105170207 ) in their Java...; io.streamnative - pulsar-package-core version 2.8.0-rc-202105170207 in Java...-package-core version 2.8.0-rc-202105170207 java library in your project. Now
Maven dependency for io.streamnative - pulsar-package-core version 2.8.0-rc-202105170904 is released. Learn to use pulsar-package-core version 2.8.0-rc-202105170904 in Maven based Java projects
( io.streamnative - pulsar-package-core version 2.8.0-rc-202105170904 ) in their Java...; io.streamnative - pulsar-package-core version 2.8.0-rc-202105170904 in Java...-package-core version 2.8.0-rc-202105170904 java library in your project. Now

Ads