JAVA PROGRAMMING QUESTIONS
Number Programs:
1. Write a program for swapping of two numbers with and without using third
variable?
2. Write a program to print the Factorial of a given number?
3. Write a program to print the first 10 Fibonacci Series?
4. Write a program to check whether the given number is a prime number or not?
5. Write a program to print all the prime numbers up to a given number?
6. Write a program to check whether the given number is a palindrome or not?
7. Write a program to check whether the given number is armstrong or not?
Array Programs:
8. Write a program to reverse the array?
9. Write a program to find the sum of elements in an array?
10. Write a program to remove an element from the given array?
11. Write a program to check whether the given element is present in an Array?
12. Write a program on highest element in a given array?
13. Write a program on lowest element in a given array?
14. Write a program to check if an array of integers contains only odd numbers?
15. Write a program to check if an array of integers contains only even numbers?
16. Write a program on linear search?
17. Write a program on binary search?
18. Write a program on selection sort?
19. Write a program on bubble sort?
20. Write a program on left rotation of an array?
21. Write a program on right rotation of an array?
22. Write a program to print the frequency of each character in the given String or
not?
23. Write a program to print duplicate elements in a given array?
24. Write a program on sum of duplicate elements in a given array?
25. Write a program to remove duplicate elements in a given array?
String Programs:
26. Write a program to reverse the given string using String api methods ?
27. Write a program to reverse the given string without using api methods?
28. Write a program to check whether the given String is a palindrome or not?
29. Write a java program to check whether the given character is present in the
String or not?
30. Write a program to remove the given character from the given String?
31. Write a program to check whether the vowel is present in a string?
32. Write a program to print the frequency of each character in the given String or
not?
33. Write a program to print duplicate characters in the given String?
34. Write a program to remove duplicate character in a given string?
35. Write a program on all possible substring in a string?
36. Write a program to print all palindrome sub Strings of a String?
37. Write a program to remove all white spaces from string?
38. Write a program to print all palindrome words present in the given Sentence?
Other Programs:
Practice all pattern programs
Practice all programs from Coding Bat website