The document outlines the question pattern and sections for a Java exam. It includes 25 questions in Section A (2 marks each) and 16 questions in Section B (4 marks each). The exam is 50 minutes long and worth a total of 20 marks. Section A can include 2 out of the 4 questions and Section B requires 4 out of the 6 questions. The questions cover topics in Java including operators, loops, arrays, strings, OOP concepts, inheritance, polymorphism, abstraction, and more. Sample programs are provided with some questions.
The document outlines the question pattern and sections for a Java exam. It includes 25 questions in Section A (2 marks each) and 16 questions in Section B (4 marks each). The exam is 50 minutes long and worth a total of 20 marks. Section A can include 2 out of the 4 questions and Section B requires 4 out of the 6 questions. The questions cover topics in Java including operators, loops, arrays, strings, OOP concepts, inheritance, polymorphism, abstraction, and more. Sample programs are provided with some questions.
Section-A: Answer any 2 out of 4 questions (2×2mark=4mark)
Section B: Answer any 4 out of 6 questions (4×4mark=16mark)
JAVA Questions on Unit-1
SECTION-A (2 mark Questions)
1. State four features of java.
2. What is garbage collection in java? 3. What are the Labeled Break and Continue statements? 4. Define the term static method with example. 5. Define JVM and JRE. Explain why Java is platform independent. 6. What do you mean by operator precedence? 7. What are the bitwise operators available in java? 8. What is a Constructor? 9. What do you mean by Method Overloading? 10. What is Object Oriented Programming? How it is different from Procedural concepts? 11. What is an Object? How to allocate memory for objects? 12. Can a method be overloaded based on different return type but same argument type? 13. What is for each loop? Write the syntax of it. 14. Differentiate between class and objects. 15. What is Scanner class?
SECTION-B (Long questions)
1. What is operator in java? Explain different categories of operators with example.
2. Write a program to implement the Fibonacci series using for loop control structure. 3. Write a program to find out whether the given number is palindrome or not. 4. Write a program to search a number in an array. 5. Write a program to demonstrate the following (a) to convert lower case string to upper case.(b) to compare two strings. 6. Explain the features of OOP. 7. Explain Type casting in java. 8. Explain switch statement with an example. 9. Write a Java program to print the prime numbers between 150 and 500. Using while loop. 10. Explain static members with an example. 11. Explain command line argument with a program. 12. Write a Java program to find the roots of a quadratic equation for all cases. 13. Write a Java program to find the sum of odd numbers and even numbers separately in an array. 14. Explain briefly the following object oriented concepts. i) Abstraction ii) Polymorphism iii) Encapsulation. 15. "Java is called Machine Independent language" - Justify this statement with proper explanation. 16. Write a Java program to sort a given set of strings in the alphabetical order where the strings are supplied through the command line. 17. What do you mean by static class and static method? Can we make an instance of an abstract class? Justify your answer with an example? 18. Write a Java program to generate a pyramid of numbers for given number N using for loop. 19. Discuss on the advantages and disadvantages of Object Oriented Programming. 20. Write a java program to illustrate "Constructor Overloading". 21. Discuss various control structures available in Java. 22. Explain about Java Tokens with examples. 23. What is this keyword? Explain with example. 24. Explain about static and final keywords with example. 25. What is constructor? Explain different type of constructor with example.
JAVA QUESTIONS on Module-2
SECTION-A (2 mark Questions)
1. What is the difference between Method overloading and Method overriding?
2. What is inheritance? What are its types? 3. What is the use of super keyword in java? 4. What is method overloading? 5. What is overriding of methods? 6. What is the need of overridden methods? 7. What is dynamic method dispatch? 8. What is the use of final class in Java? 9. Define an abstract class with suitable examples? 10. What are the characteristics of an abstract class? 11. What is a package? How to define a package? 12. Describe access protection? 13. What are the access specifiers in Java? 14. Explain 4 categories of visibility for class members? 15. How to import a package? 16. What is an interface? How to define it? 17. How can we access an interface from another interface and how to access from a class? 18. How many interfaces can a class inherit and can a same interface be inherited by 2 different classes? Explain it? 19. Give the differences between single, Multilevel & Hierarchical Inheritance? 20. 26. Is there multiple inheritance in Java? If not, whether there is an alternative to implement multiple inheritance?
SECTION-B
1. Write a Java Program to implement method overloading and method overriding?
2. What is multiple inheritance and how to perform it in Java? 3. Give a detailed sketch of the differences between Single, Multilevel & Hierarchical Inheritance? 4. Explain Abstract classes with an example program? Also describe the properties of abstract classes? 5. What is a Package? Explain the Packages with an example and how to import packages? 6. Describe interfaces & how to implement it with a Java Program? 7. Explain extending interfaces with a Program & Variables in a Program? 8. Describe Dynamic Method dispatch and the use of final keyword in Java with relevant Programs? 9. Explain Constructor overloading with an example? Also describe the usage of super keyword?