CHENNAI INSTITUTE OF TECHNOLOGY
(Autonomous)
Sarathy Nagar, Puduper, Chennai – 600 069.
JAVA PRACTICE PROGRAMS
1. Write a program that takes 10 student marks in an array and prints the highest, lowest, and
average.
2. Write a program to demonstrate widening type casting.
3. Write a program to generate the first 15 Fibonacci numbers.
4. Write a program to check whether a triangle is isosceles, equilateral, or scalene.
5. Write a program that breaks a loop when the sum exceeds 100.
6. Write a program to reverse a number.
7. Write a program to check whether a string is a palindrome.
8. Write a program to count vowels and consonants in a string.
9. Write a program to demonstrate the use of static method and static variable.
10. Write a program to illustrate final variable and show that it cannot be changed.
11. Write a program to show the use of this keyword to differentiate between instance variable
and parameter.
12. Write a program to demonstrate super keyword to call the parent class method.
13. Write a program where a subclass constructor calls the super() constructor.
14. Write a program using a do-while loop to keep taking input until the user enters 0.
15. Write a program that converts a double value into int and float.