Home Javacodeexamples Collection of Large Number of Java Sample Programs and Tutorials

Related Tutorials


 
 

Share on Google+Share on Google+

Collection of Large Number of Java Sample Programs and Tutorials

Advertisement
Collection of Large Number of Java Sample Programs and Tutorials Collection of Large Number of Java Sample Programs and Tutorials HelloWorld Java Program Simple Java Program for beginners that prints HelloWorld! on console.

Collection of Large Number of Java Sample Programs and Tutorials

Java Collection Examples

Java 6.0 New Features (Collection Framework)
As the name indicates
collections is a group of objects known as its elements. Basically it is a package of data structures that includes ArrayLists, LinkedLists, HashSets, etc. A collection is simply an object that groups multiple elements into a single unit. It is also called as a container sometimes. It is used to store, retrieve, manipulate, and communicate aggregate data. 

  1. Introduction to Collections API
    A collection is simply an object that groups multiple elements into a single unit. It is also called as a container sometimes. It is used to store, retrieve, manipulate, and communicate aggregate data.
      

  2. Advantages and Disadvantages of collection Framework
    In this section, you will read the advantages and disadvantages of Java Collection Framework. 
     

  3. Java 6.0 Collection Framework
    Some of the new collections APIs have been introduced in Java 6.0.
      

  4. Collections Framework Enhancement
    In Collection framework, we are able to improve the performance hashing function that is used by java.util.HashMap. It provides some new Collection interfaces also.

Lets See How to Work With Collections Framework With the Help of Following Examples.

  1. Navigable Map Example
    In NavigableMap we use methods to return the key value pair like navMap.put(1, "January"); whereas in NavigableSet we use methods to return values.
      

  2. Navigable Set Example
    In the example below we have used NavigableSet method to sort the elements in ascending order, descending order, also to retrieve the element which is immediately greater than or equal to 35 etc. 
     

  3. HashSet Example
    In this section provides you an example to HashSet collection frame work.
    A HashSet is a set that doesn't allow duplicate elements and doesn't order or position its elements.
      

  4. Linked List Example
    This section discusses an example to demonstrate the various methods of List interface. We are using two classes ArrayList and LinkedList in the example code.
     

  5. Tree Map Example
    In the following example, we have used the TreeMap method, which stores its elements in a tree and orders its elements based on their values. Here in the example we have used the key of the element to show the values of the element.
     

  6. Tree Set Example
    In the following example, we have used the TreeSet collection, which is similar to TreeMap that stores its elements in a tree and maintain order of its elements based on their values.
     

  7. What is Collection Framework?
    Java provides the Collections Framework. In the Collection Framework, a collection represents the group of the objects. And a collection framework is the unified architecture that represent and manipulate collections.
        
  8. Iterate Collection
    In this Example you will learn you will learn how to iterate collection in java. A running example of java program is provided that shows you how you can iterate collections in java.
      
  9. Converting a Collection to an Array
    Here is the illustration for the conversion from the collection to an array. In this section, you will learn how to do this.
      
  10. Converting an Array to a Collection
    Here is the illustration for the conversion from the an array to a collection. In this section, you will learn how how to do this. The given example gives you a brief introduction for converting an array to collection without losing any data or element held by the array.
        
  11. Implementing a Queue
    In this section, you will learn how to implement the queue. A queue holds a collection of data or elements and follows the FIFO ( First In First Out) rule.
        
  12. Implementing a Stack
    In this section, you will learn how to implement a stack in Java. A Stack is like a bucket in which you can put elements one-by-one in sequence and retrieve elements from the bucket according to the sequence of the last entered element.
  13. Map.Entry Java Interface
    Sometimes you need to work with map entry. This can be done using Map.Entry Interface of Java.   
Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 30, 2005

Related Tutorials

Discuss: Collection of Large Number of Java Sample Programs and Tutorials  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:16
gaurav
October 17, 2011
java programs

java program to generate 10 numbers and find longest increasing series among rhem and count the no. in series ?
amit shriwas
November 25, 2011
about antivirus

now a days the antivirus system is very imp in every field.
simple program interface example in java
December 23, 2011
java

pls give me answer to immediate
vani
February 11, 2012
hi

i want easily can write java progrms and any thing about java or java interview question and answers,ur site is nice help me
sunil
February 26, 2012
java

what is the difference between int and Integer...?
karishma
May 15, 2012
java program

how to convert a program into title case
Raj Kumar Varma
October 2, 2012
java

to find the factorial of 101
J Jagadeesh Kumar
December 10, 2012
Collection Frame Work

I Have to find this type output and what is the source code for this output OUTPUT: Enter the number of Countries to Enter:3 Enter Country Id:1 Enter Country Name:India Enter Another country Enter Country Id:2 Enter Country Name:AUS Enter Another Country Enter Country Id:3 Enter Country Name:USA Enter No.of States to Enter the Corresponding Country:6 Enter Country Id:1 Enter State:AP,UP,TN Enter Country Id:2 Enter State:syd,mus,ghr Enter Country Id:3 Enter State: meb,ske,sdi U R Entered The Countries with Corresponding States as given bellow and the countries are in Sorting order AUS:syd,mus,ghr IND:AP,UP,TN USA:meb,ske,sdi
devanand vaishnav
November 16, 2013
java

java is my best learn language
DMCA.com