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



Home Answers Viewqa Java-Interview-Questions core java collection package

Have Programming Question? Ask it here!
 
 
 


Ashwani
core java collection package
1 Answer(s)      5 years and 11 months ago
Posted in : Java Interview Questions



Advertisement
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
CORE JAVA
CORE JAVA  What is Garbage collection in java? What is the role of a developer for garbage collection
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 collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections and Collection
Java package
Java package  Which package is always imported by default
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
core java
core java  how to display characters stored in array in core java
CORE JAVA
CORE JAVA  Which collection is more feasible to store unique objects? Which collection is better to store objects where insertion order should be preserved? Can we use Enumeration for displaying list objects
core java
core java  basic java interview question
Java collection
Java collection  What is relation between map and set
Java Collection
Java Collection  What are Vector, Hashtable, LinkedList and Enumeration
Java collection
Java collection  What are differences between Enumeration, ArrayList, Hashtable and Collections
CORE JAVA
CORE JAVA  CORE JAVA PPT NEED WITH SOURCE CODE EXPLANATION CAN U ??   Core Java Tutorials
core java
core java  i need core java material   Hello Friend, Please visit the following link: Core Java Thanks
java collection
java collection  how do I use a treeset to print unique words
core java
core java  Hi, can any one expain me serialization,Deseralization and exterenalization in core java
core java
core java  Hi, can any one exain me the concept of static and dynamic loading in core java
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
core java
core java  Hi, I am facing problem in adding/inserting an elemnts in array. can any one please sahre the code for the same without using collection(Built in function) Regards": Akash
Core JAva
Core JAva  how to swap 2 variables without temp in java
core java
core java  how can we justify java technology is robust
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 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
core java
core java  what is the Difference between collections and reference... structure for arrays while for every collection class underlying data structure...) In an array the values are side by side, while collection scatter the values
core java
core java  its compulsory to save file name and class name is same in java
Core Java
Core Java  How to execute cmd command through java?? Give Code of them
core java
core java  write a java program to view product details from product table
Core Java
Core Java  Hi, Can any one please share the code for Binary search in java without using builtin function
Core Java
Core Java  Please write a Java Program to design login form and store the values in file & validate and display the MainForm
core java
core java  In java primitive variables will get its default value automatically after declaration. Then why it is mandatory to initialize a variable before using
core java
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
core java
core java  Hello sir,What is logic behinde the core java programms,How may programmas are there,for example,sorting of two numbers,grade of the student details,fibonice serice,paldroma,incremting of the program,asscedding
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
Core Java
Core Java  Hi, Can any one please expain me why derived data types are required in java as we have primitive data types with us
Core Java
Core Java  Hi, Can any one please expain me why derived data types are required in java as we have primitive data types with us
Core Java
Core Java  Hi, can any one please tell me the uses of return type,"Super" and "this" calling statement in Java?? why do we required this,super calling statement?? why return type is required
Core Java
Core Java  How to load class dynamically in java ?   To load class dynamically you can use Class class method Class.forName("abc.xyz.MyClass"); This method load the given class at run time
Core Java
Core Java  what is a class
Core Java
Core Java   How can i write own compile time and runtime exceptions in java   Hello Friend, Please visit the following links: http://www.roseindia.net/java/exceptions/how-to-throw-exceptions.shtml http
add new package java
add new package java  How to add new package in Java
Core Java
Core Java  Is Java supports Multiple Inheritance? Then How ?   Hi Friend, Java does not support multiple inheritance but it can be achieved by using the interface. In Java, Multiple Inheritance can be achieved through
Core java
Core java  How to use hyperlink that is href tag in core java without swing, frames etc. My code is StringBuffer oBodyStringBuffer = new StringBuffer("Message Classification: Restricted.\n\n
CORE JAVA
CORE JAVA  What is called Aggregation and Composition
core java
core java  surch the word in the given file
Core Java
Core Java   Hi, Can any one please tell me the program to print the below matrix in a spiral order. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Thanks a lat in advance
core java
core java  I am having 10 countries in the data base as back end.in front end i am having a button in web page like SHOWCOUNTRIESLIST so i need java code how to retrive that 10 countries from back end to my page,,pls help me
Advertisements
 

 

 

DMCA.com