Object Oriented programming in Java
Unit 1
Q1. Write a short note on Class and Object.
Q2. Explain different data types in JAVA.
Q3. What is Array Also explain array index and what types are valid for Array indexes.
Q4. Explain Access specifiers used in Java
Q5. What is Constructor? What happens if you keep a return type for a constructor.
Q6. Differentiate between No-arg constructor and parameterized constructor.
Q7. What is array? Also explain array index and what types are valid for array indexes?
Q8. Differentiate between JDK, JRE and JVM.
Q9. Write short note on-
i) JIT compiler
ii) Byte code in java
iii) Data types
Q10. What is Constructor? Write any one program based on Constructor.
Q11. Explain in brief about JVM.
Q12. Explain the following operators used in Java with suitable example:
(i) Logical operators
(ii) Bitwise operators
(iii) Relational operators
(iv) Arithmetic operators.
Q13. Write any one Java program using switch case statement.
Unit 2
Q1. Explain why multiple inheritance is not supported in Java?
Q2. Write a short note on Polymorphism with suitable example.
Q3. What is Dynamic method Dispatch? Explain with suitable example.
Q4. What is inheritance? Explain different forms of inheritance with suitable program
segments and real world example classes.
Q5. Declare a class Vehicle and from this class derive two wheeler, four_wheeler class
Display properties of each type of vehicle using member function of the class. Use data
hiding concept for this implementation.
Q6. What is method overriding explain with suitable example?
Q7. What is dynamic method dispatch? Explain with suitable example.
Q8. What is inheritance? Illustrate the application of inheritance with suitable example.
Q9. Describe the following:
(1) super
(i) this
(ii) final keyword.
Q10. Discuss the different access modifiers in Java
Q11.What is inheritance? Explain different forms of inheritance with suitable program
segments and real world example classes.
Q12. Explain method overloading and overriding with example.
Unit 3
Q1. Differentiate between Interface and Abstract Class in Java.
Q2. Define Interface. Explain how to implement interface in Java.
Q3. What is Package? Explain its types with suitable example.
Q4. Write a sample program to implement multiple inheritance using Interface.
Q5. Explain about interface variables and what modifiers are applicable for them.
Q6. What is package? Explain its types with suitable example.
Q7. An interface contains only abstract methods and an abstract class also can contain only
abstract methods then what is the necessity of interface?
Q8. What is a marker interface? Give an example?
Q9. Explain about interface methods and what modifiers are applicable for them?
Q10. Differentiate between Interface and Abstract Class in Java.
Q11. What is the difference between an interface and class? With the help of suitable Java
program explain the purpose of interfaces in Java. 7
Q12. Define Packages. How to create and access package in Java?
Q13. Write a sample program to implement multiple inheritance using Interface.
Unit 4
Q1. Write a Java program to delete duplicate numbers from the file.
Q2. What do you mean by stream? Write the hierarchy of stream classes & write the
constructors used by any one type of stream class.
Q3. Write a Java program that reads a text file and copy its contents to another file.
Q4. Write a Java program to perform merging of two files.
Q5. What is stream? Explain the different types of streams in java?
Q6. Write a java program to check whether the file is readable hidden or writable?
Q7. Write a program to delete duplicate numbers from the file.
Q8. Write a java program to performed merging of two files?
Q9. Write a Java program to delete duplicate numbers from the file
Q10. What is stream class in Java ? Explain different types of streams in Java.
Q11. Write a program in Java that reads a text file 'input.txt' and copy the contents to another
text file 'output.txt' using command line argument. 7
Q12. Write a Java program to perform merging of two files.
Unit 5
Q1. Explain in brief about classification of Exception.
Q2. Write short notes on:
(1) try
(n) catch
(i) finally
(iv) throws
Q3. Explain in short following thread methods with example:
(1) Set name ()
(ii) Get Name()
(m) Current thread ()
(iv) Sleep ()
(v) Is Alive ()
Q4. What is Thread deadlock? How can you resolve deadlock situation?
Q5. Explain the life cycle of a Thread?
Q6. What is a class level and object level lock? When it is required?
Q7. Explain the purpose of following methods:
i) wait()
ii) notify()
iii) yield()
Q8. What do you mean by exception? Explain the throw keyword used in exception handling
in Java 6
Q9. Explain the purpose of following methods:
(1) wait()
(ii) notify()
(ii) yield().
Q10. Explain the life cycle of a Thread.
Q12. Explain following concept in Java:
(1) Checked exception
(ii) Built-in exception
- by Shreyash Rahangdale
- ig- @itsme_shreyash_06