Java Programs
Java Programs
Basic programs:
1.palindrome of a number
2.Palindrome of a String
3.Fibnoci series
4.Factorial program
String programs:
string="thisisjavaclass";
string="ThiSisJavaclaSs";
string="ThiSis@Java*c#laSs345";
17.write a program to count vowels and consonants in a string using scanner class.
string="Helloworld";
string="thisisjavaclass";
19.write a program to Reverse each word in a string
string="thisisajavaprogram";
string s1="qualitythought";
Array programs:
int[] a ={7,5,3,3,2,4,5,7,9}
33. write a program to find 3rd highest number in an array using sort functionality and without using
sort functionality.
int[] a ={70,5,30,3,2,4,15,7,9}
34. write a program to swap two numbers with and without using third variable.
37.write a program to get the sum of odd and even numbers in an array.
int[] a ={70,5,30,3,2,4,15,70,5,5,30,5,6,5}
39.write a program to find total uppercase and lowercase letters in each word in an array.
string[]s={"tHiS","Is","jAVa","Class"}
Switch programs:
42. Day number to Day Name
Collections Programs:
46.Write a java program to create a array list and add elements and print them
47.Write a javaprogram to print a array list in Reverse Order with and With out using Reverse Order
49.Remove Duplicates from array list (With and With out Linked hash set)
50.Program to replace 58 with 85 in the below array list and print updated array list
52.Extract some of the elements from the main arraylist and print extracted elements(use
arrayfunctions)
53. Extract some of the elements from the main arraylist and print extracted elements(use
arrayfunctions)
output: = ["geeta","seeta"].
HashMap Programs:
54. write a program to print count of no of duplicates of repeated characters using hashmap.
string="wearestartingselenium"
string="wearestartingseleniumtommorow"