0% found this document useful (0 votes)
4 views2 pages

Java Questions

The document provides a list of beginner-level Java programming questions for practice, categorized into sections such as Java Basics, Variables & Data Types, Control Statements, Loops, Arrays, and Strings. Each section contains various tasks, such as printing messages, performing calculations, and manipulating data structures. Additionally, the author offers to create a PDF version of the questions for easier printing and practice.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Java Questions

The document provides a list of beginner-level Java programming questions for practice, categorized into sections such as Java Basics, Variables & Data Types, Control Statements, Loops, Arrays, and Strings. Each section contains various tasks, such as printing messages, performing calculations, and manipulating data structures. Additionally, the author offers to create a PDF version of the questions for easier printing and practice.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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?

You might also like