Uploaded by Rooh Sheraz

Basic Java Programming Questions for Practice

advertisement
Basic Java Programming Questions for Practice:
1. Write a Java program to print "Hello, World!" to the console.
2. Write a program to calculate and print the sum of two numbers using Method.
3. Create a program that checks if a given number is even or odd and prints the result.
4. Write a Java program to find the factorial of a number using a loop.
5. Create a program that converts temperature from Celsius to Fahrenheit using the method “converts()”.
6. Write a program to find the largest number among four given numbers using Math methods.
7. Create a program to check if a year is a leap year.
8. Write a Java program to find the Fibonacci series up to a given number of terms.
9. Create a program to reverse a string in Java.
10. Write a program that calculates the area of a circle given its radius using the method “calculates()”.
Download