Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

core java collection package

Ads

 
 

Share on Google+Share on Google+

Ashwani
core java collection package
1 Answer(s)      9 years ago
Posted in : Java Interview Questions
Ads
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

Ads









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 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 package
Java package  Which package is always imported by default
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection
Java package
Java package  What restrictions are placed on the location of a package statement within a source code file
Collection in java
Collection in java  What are the meaning of the letters E,T,K and V that come in the collection concept
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
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 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 collection
java collection  how do I use a treeset to print unique words
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.util package - Java Beginners
java.util package  Design a Date class similar to the one provided in the java.util package.? Thanks in ADVANCE....  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/java/core
add new package java
add new package java  How to add new package in Java
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
Package in Java - Java Beginners
Package in Java  Hi, What is a package? Tell me how to create package? Thanks   Hello, packeage is nothing but you can say that folder of related java files. ex, if you write a jaava class like
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
Package categories in Java
Package categories in Java     ... in the hierarchy structure: Build-In Packages in Core Java: Java packages can....  java.nio This package handles New I/O framework for Java
about package - Java Beginners
package. I am unable to understand as it is a rule to create the package in the root directory.In my system java is installed in c:\ibm\java142\bin how can i run...://www.roseindia.net/java/master-java/java-package.shtml Hope
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 knowledge. 
Java Util Package - Utility Package of Java
Java Util Package - Utility Package of Java       Java Utility package is one of the most commonly used packages in the java program. The Utility Package of Java consist
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... of the collection interfaces. Also, they are reusable data structures. Algorithms
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
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
CORE JAVA
CORE JAVA  What is Garbage collection in java? What is the role of a developer for garbage collection