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

AIML R23-OOP Through JAVA 5 Marks Questions

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)
20 views2 pages

AIML R23-OOP Through JAVA 5 Marks Questions

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

OOP Through JAVA 5 Marks Questions

UNIT-1
1. Explain basic concepts of OOP. (CO1, K2)
2. Explain Features of JAVA. (CO1, K2)
3. Explain control statements in JAVA with suitable examples. (CO1, K2)
4. Write a program to check whether a given integer number is Strong number or not. [Hint: Strong
Number (145=>1! +4! + 5! = 145) (CO1, K3)
5. Write a program to check whether a given integer number is Magical number or not. [Hint: Magical
Number (1729=>sum=1+7+2+9=19 rev=91 mul=sum*rev=19*91=1729) (CO1, K3)
6. Write a program to check whether a given integer number is Armstrong number or not. [Hint: Armstrong
Number (153=>1^3+5^3+3^3=153) (CO1, K3)
7. Develop a program to accept two integers as command line arguments and print the sum of the
two numbers. (CO1, K3)
8. Explain Method Overloading with an example. (CO1, K2)
9. Explain different types of Constructors with suitable examples. (CO1, K2)
10. Explain three uses of this keyword with suitable example for each use. (CO1, K2)

UNIT-2

1. Illustrate ArrayList and its methods. (CO2, K2)


2. Develop a program to reverse the elements of a given 2*2 array. Four integer numbers
need to be passed as Command Line arguments. (CO2, K3)
3. Illustrate HashMap and its methods. (CO2, K2)
4. Illustrate HashSet and its methods. (CO2, K2)
5. Explain String class and its methods in detail. (CO2, K2)
6. Explain StringBuffer class and its methods in detail. (CO2, K2)
7. Differentiate String and StringBuffer class. (CO2, K3)
8. Write a program to initialize an integer array with values and check if a given number is
present in the array or not. If the number is not found, it will print -1 else it will print the
index value of the given number in the array. (CO2, K3)

UNIT-3

1. Explain different types of inheritance with an example. (CO3, K2)


2. Differentiate Interface and Abstract class. (CO3, K3)
3. Explain method overriding with an example. (CO3, K2)
4. Explain how multiple inheritance concept is achieved through interfaces with an example. (CO3,
K2)
5. Explain the procedure of creating user defined package with an example. (CO3, K2)
6. Create an interface Vehicle with a default method message () that returns nothing and prints
"Inside Vehicle". Create an interface FourWheeler with a default method message () that returns
nothing and prints "Inside FourWheeler". Create a class Car implementing these two interfaces.
In this class, Override the message () method and call the message () method of the Vehicle
interface using super keyword. Instantiate the class, call the message method and print the output.
(CO3, K3)
7. Create a package called test package. Define a class called foundation inside the test package.
Inside the class, you need to define 4 integer variables: var1 with private access modifier, var2
with default access modifier, var3 with protected access modifier and var4 with public access
modifier. Import this class and packages in another class. Try to access all 4 variables of the
foundation class and see what variables are accessible and what are not accessible. (CO3, K3)
8. Explain different types of access modifiers with examples. (CO3, K2)

UNIT-4

1. Explain Exception Handling mechanism with a neat diagram. (CO4, K2)


2. Explain Multiple Catch Statements with an example. (CO4, K2)
3. Explain Thread Life Cycle with a neat diagram. (CO4, K2)
4. Develop a java program to implement Thread Synchronization. (CO4, K3)
5. Develop a program that take an input String from user and parse it to integer, if it is not a
number it will throw number format exception Catch it and print "Entered input is not a
valid format for an integer." or else print the square of that number. (CO4, K3)
6. Explain thread priorities in java with an example. (CO4, K2)
7. Write a Program with a division method which receives two integer numbers and performs
the division operation. The method should declare that it throws ArithmeticException. This
exception should be handled in the main method. (CO4, K3)
8. Write a program to create two threads, one thread to display all even numbers between 1
& 20, another to display odd numbers between 1 & 20. (CO4, K3)
9. Write a program to create three threads with different priorities- MAX, MIN, NORM and
start the threads at the same time. (CO4, K3)

UNIT-5

1. Explain different types of JDBC drivers with neat diagrams. (CO5, K2)
2. Explain the architecture of JDBC with a neat diagram. (CO5, K2)
3. Explain the purpose of the Reader and Writer classes in Java. How do they differ from
InputStream and OutputStream? (CO5, K2)
4. Write a program to count the number of times a character appears in a File. (CO5, K3)
5. Write a program to count the occurrences of each word in an input file and write the word
along with its corresponding count in an output file. [Note: The words should be sorted
alphabetically in the output file]. (CO5, K3)
6. Develop a program to copy contents of one file to another file. (CO5, K3)
7. Develop a JDBC program to retrieve data from the database. (CO5, K3)
8. Develop a JDBC program to insert data into the database. (CO5, K3)

You might also like