0% found this document useful (0 votes)
12 views1 page

Java Question Paper

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)
12 views1 page

Java Question Paper

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/ 1

Core Java Question Paper (Total: 100 Marks)

Section A: Theory What is Java? Explain its main features.

1. What is a constructor in Java? Explain with an example.


2. Explain the concept of Object-Oriented Programming (OOP) and its main
principles.
3. What is the purpose of the return statement in a method?
4. What is the significance of the void keyword in Java?
5. What is the difference between a while loop and a do-while loop in Java?

Section B: Code Writing

7. Write a Java program to check if a given number is even or odd.


8. Write a Java program to find the largest of three numbers.
Write a Java program to print a diamond pattern using stars (*)
9. Write a Java program to print the Fibonacci series up to 10 terms.
10. Write a Java program that reads an array of integers and prints the sum of all
elements in the array.
11. Write a Java program to count the number of vowels in a given string.
12. Implement a simple Java program to create a multiplication table for a given
number.

Section C: Problem Solving

14. Write a Java program to find the factorial of a number using a loop.

15. You are given an array of integers. Write a Java program to find the smallest
and largest elements in the array.

16. Write a Java program to check if a given string is a palindrome.

17. Write a Java program that takes an array of integers and sorts them in
ascending order.

You might also like