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

Java 20 Coding Questions Exam

The document contains a list of 20 coding questions focused on Java programming. Each question requires the implementation of specific Java programs, covering topics such as basic input/output, control structures, object-oriented programming concepts, and exception handling. The questions are designed to test various programming skills and concepts in Java.

Uploaded by

dipti01shamra
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)
8 views2 pages

Java 20 Coding Questions Exam

The document contains a list of 20 coding questions focused on Java programming. Each question requires the implementation of specific Java programs, covering topics such as basic input/output, control structures, object-oriented programming concepts, and exception handling. The questions are designed to test various programming skills and concepts in Java.

Uploaded by

dipti01shamra
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

COMPUTER SCIENCE – JAVA PROGRAMMING

20 Coding Questions | Answer All Questions

Q1. Write a Java program to print "Hello World".

Q2. Write a Java program to add two integers using user input.

Q3. Write a Java program to check whether a number is even or odd.

Q4. Write a Java program to find the largest of three numbers.

Q5. Write a Java program to swap two numbers without using a third variable.

Q6. Write a Java program to find the factorial of a number.

Q7. Write a Java program to generate the Fibonacci series.

Q8. Write a Java program to check whether a number is prime.

Q9. Write a Java program to reverse a number.

Q10. Write a Java program to check whether a string is a palindrome.

Q11. Write a Java program to find the sum of digits of a number.

Q12. Write a Java program to count vowels in a string.

Q13. Write a Java program to demonstrate method overloading.

Q14. Write a Java program to demonstrate constructor overloading.

Q15. Write a Java program to implement single inheritance.

Q16. Write a Java program to demonstrate method overriding.

Q17. Write a Java program to handle an exception using try-catch.


Q18. Write a Java program to create a file using File class.

Q19. Write a Java program to read input using Scanner class.

Q20. Write a Java program to demonstrate the use of an interface.

You might also like