Core Java Example Programs

Number of View: 5918

 

SNO Program
  Programs on Hashset in java
1 How to create HashSet in java?
2 How to find size of HashSet in java?
3 How to iterate over HashSet in java using Iterator?
4 How to verify an element exists in HashSet?
5 How to clone HashSet in java?
6 How to convert HashSet to array of values in java?
7 HashSet-addAll() method to add collection to HashSet?
8 How to remove elements from HashSet?
9 How to remove all elements from HashSet?
10  HashSet IsEmpty Example in java ?
   
11 Programs on Strings in java
 12  How to convert long to String in java?
13  How to convert Integer to String in java?
14  How to reverse String in java without using String class reverse method?
 15 How to reverse String in java using StringBuilder class?
 16  Program to reverse words in a String in java?
 17 How to check if a String is empty or not in java?
 18 String concatenation example using + operator
 19 How to concatenate two Strings in java?
 20 How to check if a string ends with particular character in java?
 21 How to copy only some characters from a string in java?
 22 How to copy string using valueOf() method in java?
 23 How to check if a letter is in String or not in java?
 24 How to compare two Strings content in java?
 25 How to compare two Strings in java ignoring case?
 26 How to compare strings in java?
 27 How to compare string using equals() in java?
 28 How to copy String using getChars() example in java?
 29 How to find the index of character in a String in java?
 30 How to remove last character from string in java?
 31 How to remove leading zeroes from String in java?
 32 How to find the last postion of a character in String in java?
 33 How to find length of String in java?
   
   Programs on Dates in java
 34 How to convert String to Date in java?
 35 How to convert Date to String in java?
 36  How to display month names in java?
 37  How to create Date Object in java?
 38  How to add two dates in java?
 39  How to find difference between two dates in java?
 40 SimpleDateFormatter Examples in java
 41 Display date in yyyy-MM-dd HH:MM:SS fomat in java
 42 How to Display time in hh:mm:ss format in java?
 43 How to display date in AD Format in java?
 44 How to display day of week in java?
 45 How to display time in java ?
 46 How to display timezone in java?
 47 How to display date in dd/mm/yyyy hh:ss:mm format in java?
 48 SimpleDateFormatter Localized Pattern Example in java?
 49 How to display full month names in java?
   
   
  Programs on Threads in java
 50 How to create thread using Runnable interface in java? 
 51 How to create thread by extending Thread class in java? 
 53 Example for thread sleep method in java?
54 How to set thread name in java?
  Programs on Nested classes and Inner classes in java
 52 Member Inner class Example in java
 53  Method Local Inner class Example in java
 54 Static Nested class Example in java
   
  Programs on Numbers in java
 55 How to check a given number is palindrome or not in java?
 56 How to round decimal values to nearest number in java?
   
  Arrays
 57 Sorting Array using sort() in java
58 How to copy array values in java?
   
  ArrayList
59) How to add elements to arraylist in java?
60) Does Arraylist maintains insertion order of elements see this example?
61) Does Arraylist allows duplicates see this example?
62) How to add elements to arraylist at specified position?
63) How to retrieve elements in arraylist using iterator?
64) How to add a collection to arraylist in java?
65) How to remove all elements from arraylist?
66) How to remove element from arraylist in java?

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

HTML tags are not allowed.