Here’s a list of beginner-level Java sample questions (no answers) that you can use for
practice:
Java Basics
1. Write a Java program to print "Hello World" on the screen.
2. Write a Java program to print your name, age, and city.
3. Write a Java program to add two numbers and display the result.
4. Write a Java program to calculate the area of a rectangle.
5. Write a Java program to convert temperature from Celsius to Fahrenheit.
Variables & Data Types
6. Write a Java program to swap two numbers using a temporary variable.
7. Write a Java program to find the square and cube of a number.
8. Write a Java program to check whether a number is even or odd.
9. Write a Java program to calculate the simple interest.
10. Write a Java program to calculate the perimeter of a circle.
Control Statements
11. Write a Java program to find the largest of two numbers.
12. Write a Java program to find the largest of three numbers.
13. Write a Java program to check whether a number is positive, negative, or zero.
14. Write a Java program to check if a year is a leap year.
15. Write a Java program to display numbers from 1 to 10 using a loop.
Loops
16. Write a Java program to print the multiplication table of a given number.
17. Write a Java program to find the sum of the first 10 natural numbers.
18. Write a Java program to reverse a number.
19. Write a Java program to print the Fibonacci series up to n terms.
20. Write a Java program to find the factorial of a number.
Arrays
21. Write a Java program to store 5 numbers in an array and print them.
22. Write a Java program to find the largest element in an array.
23. Write a Java program to find the smallest element in an array.
24. Write a Java program to find the sum of all elements in an array.
25. Write a Java program to search for an element in an array.
Strings
26. Write a Java program to find the length of a string.
27. Write a Java program to convert a string to uppercase.
28. Write a Java program to check whether a string is a palindrome.
29. Write a Java program to count the number of vowels in a string.
30. Write a Java program to reverse a string.
If you want, I can make a PDF with these beginner Java questions so you can print and
practice.
Do you want me to prepare that?