JavaImpQuestions Set1
JavaImpQuestions Set1
JavaImpQuestions Set1
2 Marks Questions
14. Implement a nested if-else statement to determine if a given number is positive, negative, or zero.
15. Write a Java program to find the factorial of a given number using recursion.
10 Marks Questions
16. Analyze the advantages and disadvantages of OOP compared to procedural programming.
17. Discuss the impact of different data types on memory usage and performance in Java.
18. Explain the role of control statements in algorithm development and problem-solving.
19. Compare and contrast the while, do-while, and for loops in terms of their usage and efficiency.
20. Evaluate the benefits and drawbacks of using the ternary operator in Java code.
22. Evaluate the potential performance implications of using nested loops in Java programs.
UNIT-II
2-Mark Questions
5. What is the significance of the ‘final‘ keyword when applied to a class or method?
11. Write a constructor method for a class that initializes its member variables.
12. Use the ‘this‘ keyword to refer to the current object within a method.
13. Overload a method to perform different actions based on the types or number of arguments.
10-Mark Questions
16. Analyze the advantages and disadvantages of using access control modifiers in Java.
17. Discuss the impact of passing arguments by value or by reference on function behavior.
18. Explain the role of constructors in object initialization and their relationship to other methods.
19. Compare and contrast method overloading and method overriding in terms of their usage and
implications.
20. Evaluate the benefits and drawbacks of using nested classes in Java code.
21. Analyze the trade-offs between using constructors and other methods for object initialization.
UNIT-III
2-Mark Questions
12. Implement a class hierarchy to represent different types of shapes (e.g., circle, rectangle, triangle).
13. Create an interface to define the behavior of a vehicle and implement it by different vehicle classes.
10 Marks Questions
17. Write a java program to find minimum and maximum element in an array.
20. Java programs for matrix operations like addition, subtraction, multiplication, and transpose.
24. How to inherit public, private, protected members of a super class in to sub class? Explain.
25. What is super key word? How access based class members into sub class using super?
28. What is abstract class? how to define it? how to use it in inheritance?
30. How to define interface? Explain how to access interface members in java?
32. Evaluate the potential benefits and drawbacks of using annotations for code generation and analysis
UNIT-IV
2-Mark Questions
10. What is the difference between byte streams and character streams in Java I/O?
12. Write a Java program that uses the ‘Math‘ class to perform mathematical calculations.
14. Use the ‘Scanner‘ class to read input from the user.
10 Marks Questions
18. How to create user define packages? How to use them in java program?
19. How to add class or interface to already existing package in java? Explain.
21. Draw and explain the hierarchy of standard exception class in java?