Question Bank (MSBTE) Unit I-III
Question Bank (MSBTE) Unit I-III
2m
1. List any eight features of Java.(S-19)
2. Name the wrapper class methods for the following:
(i) To convert string objects to primitive int.
(ii) To convert primitive int to string objects(S-19)
3. Define constructor. List its types.(W-19)
4. Define class and object(W-19)
5. List any four Java API packages.(W-19)
6. Define array. List its types.(W-19)
7. List access specifiers in Java(W-19)
8. Enlist the logical operators in Java.(S-22)
9. Give the syntax and example for the following functions
i) min ( )
ii) Sqrt ( )(S-22)
10. Enlist any four inbuilt packages in Java.(S-22)
11. State any four relational operators and their use.(W-22)
12.Enlist access specifiers in Java.(W-22)
13.Explain constructor with suitable example.(W-22)
14.a)Define the terms with example i)Class ii) Object(S-23)
15.Enlist any two access specifier with syntax.(S-23)
16.Give use of garbage collection in java. (S-23)
17.Enlist any two logical operators and two bitwise operators(W-23)
18.Define constructor(W-23)
19.Write down the syntax of array declaration,initialization (W-23)
20.State the significance of Java Virtual Machine (JVM) in the Java programming
environment (S-24)
21.Define array. List its type(S-24)
22.State use of finalize( ) method with its syntax(S-24)
23.
4m
1. Explain the concept of platform independence and portability with respect to Java
language (S-19)
2. Explain the types of constructors in Java with suitable example(S-19)
3. Define a class student with int id and string name as data members and a method void
SetData ( ). Accept and display the data for five students(S-19)
4. Describe instance Of and dot (.) operators in Java with suitable example(S-19)
5. Explain the four access specifiers in Java(S-19)
6. Differentiate between method overloading and method overriding(S-19)
7. Differentiate between String and String Buffer(W-19)
8. Define a class circle having data members Pi and radius. Initialize and display values of
data members also calculate area of circle and display it(W-19)
9. Define type casting. Explain its types with syntax and example(W-19)
10.Explain any two logical operators in Java with example(W-19)
11.Differentiate between array and vector(W-19)
12.List any four methods of string class and state the use of each(W-19)
13.Write a program to create vector with five elements as (5, 15, 25, 35, 45). Insert new
element at 2nd position. Remove 1st and 4th element from vector(W-19)
14.Explain any four features of Java.(S-22)
15.Write the difference between vectors and arrays. (any four points)(S-22)
16.Write a Java program to find out the even numbers from 1 to 100 using for loop.(S-22)
17.Explain any four visibility controls in Java.(S-22)
18.Explain switch case and conditional operator in java with suitable example.(S-22)
19.Write a java program to sort an 1-d array in ascending order using bubble-sort.(S-22)
20.Write a program to check whether the given number is prime or not.(W-22)
21.Define a class employee with data members ‘empid’, ‘name’ and ‘salary’. Accept data
for three objects and display it.(W-22)
22.Write a program to find reverse of a number.(W-22)
23.Write all primitive data types available in Java with their storage sizes in bytes.(W-22)
24.Write a program to add 2 integer, 2 string and 2 float values in a vector. Remove the
element specified by the user and display the list.(W-22)
25.Develop a program to create a class ‘Book’ having data members ‘author’, ‘title’ and
‘price’. Derive a class ‘BookInfo’ having data member ‘stockposition’ and method to
initialize and display the information for three objects.(W-22)
26.Describe type casting in java with example.(S-23)
27.Differentiate between string and string buffer class (any four points)(S-23)
28.Write a program to print all the Armstrong numbers from 0 to 999.(S-23)
29.Describe any four features of java.(S-23)
30.Explain any four methods of vector class with example.(S-23)
31.Write a program to copy all elements of one array into another array.(S-23)
32.Write a program to display ASCII value of a number 9(W-23)
33.Write a program to sort the elements of an array in ascending order(W-23)
34.Write a program which displays functioning of ATM machine, (Hint : Withdraw, Deposit,
Check Balance and Exit)(W-23)
35.Differentiate between method overloading and method overriding(W-23)
36.Explain implicit and explicit type conversion with example in detail(W-23)
37.Write a program to show the use of copy constructor(W-23)
38.Explain the concept of platform independence in Java and discuss how it is achieved.
Give example to illustrate the concept.(S-24)
39.What happens if you don't define any constructor in a class? Can you still create objects
of that class? Explain with example(S-24)
40.Define a class employee with data members ‘empid’, ‘name’ and ‘salary’. Accept data for
three objects and display it(S-24)
41.Explain any two logical operators in Java with example(S-24)
42.What is constructor? List types of constructor. Explain parameterized constructor with
suitable example.(S-24)
43.
6m
1. Describe the use of any methods of vector class with their syntax(S-19)
2. Explain the command line arguments with suitable example(S-19)
3. What is constructor? List types of constructor. Explain paramaterized constructor with
suitable example.(S-22)
4. Explain the difference between string class and string buffer class.
Explain any four methods of string class.(S-22)
5. Compare array and vector. Explain elementAT( ) and addElement( ) methods.(W-22)
6. Write a program to create a class ‘salary’ with data members ‘empid’, ‘name’ and
‘basicsalary’. Write an interface ‘Allowance’ which stores rates of calculation for da as
90% of basic salary, hra as 10% of basic salary and pf as 8.33% of basic salary. Include
a method to calculate net salary and display it.(W-22)
7. Write a program to check whether the string provided by the user is patindrome or
not.(W-22)
8. Explain constructor with its type. Give an example of parameterized constructor. (S-23)
9. Explain vector with the help of example. Explain any 3 methods of vector class(W-23)
10.Write a program to print the sum, difference and product of two complex numbers by
creating a class named “Complex” with separate methods for each operation whose real
and imaginary parts are entered by user(W-23)
11.Explain the concept of argument passing and the usage of 'this' keyword in Java give
example to illustrate their usage and benefits (S-24)
12.Write a program to define class Employee with members as id and salary. Accept data
for five employees and display details of employees getting highest salary(S-24)
13.
Unit 2
2m
1. State use of finalize( ) method with its syntax.(S-19)
2. List the types of inheritances in Java(S-19)
3. Define the interface in Java.(S-22)
4. List the types of inheritance which is supported by java.(W-22)
5. Give a syntax to create a package and accessing package in java(S-23)
6. List out different ways to access package from another package(W-23)
7. Define the interface in Java. Write the syntax (S-24)
8.
4m
1. Differentiate between class and interfaces(W-19)
2. Describe final variable and final method(W-19)
3. Define packages. How to create user defined package? Explain with example(W-19)
4. Explain single and multilevel inheritance with proper example.(S-22)
5. Explain how to create a package and how to import it.(S-22)
6. State the use of final keyword with respect to inheritance.(W-22)
7. Describe the package in java with suitable example.(S-23)
8. Describe interface in java with suitable example.(S-23)
9. Write a program to show the Hierarchical inheritance (W-23)
10.Explain multilevel inheritance with example (S-24)
11.How can the "super" keyword be used in inheritance? Give an example to demonstrate
its usage(S-24)
12.
(S-24)
13.
6m
1. (W-19)
2.How to create user defined package in Java. Explain with an suitable example.(S-22)
3. (S-23)
4.Develop and Interest Interface which contains Simple Interest and Compound Interest
methods and static final field of rate 25%. Write a class to implement those methods(W-23)
5.Explain the concept of packages in Java and their significance in
software development. Write an example to illustrate the usage and benefits of using
packages(S-24)
6.
Unit 3
2m
1. Write the syntax of try-catch-finally blocks(S-19)
2. Define error. List types of error(W-19)
3. Enlist any four compile time errors.(S-22)
4. Define thread. Mention 2 ways to create thread.(W-22)
5. Give a syntax of following thread method i)Notify ( ) ii) Sleep () (S-23)
6. Differentiate between starting thread with run( ) method and start( ) method(W-23)
7. Define thread. Mention 2 ways to create thread(S-24)
8.
4m
6m
1. Write a program to create two threads. One thread will display the numbers from 1 to 50
(ascending order) and other thread will display numbers from 50 to 1 (descending
order)(S-19)
2. Write a program to input name and salary of employee and throw user defined exception
if entered salary is negative(S-19)
3. Define exception. State built-in exceptions(W-19)
4. Write a Java program in which thread A will display the even numbers between 1 to 50
and thread B will display the odd numbers between 1 to 50. After 3 iterations thread A
should go to sleep for 500 ms.(S-22)
5. Define an exception called ‘No Match Exception’ that is thrown when the passward
accepted is not equal to ‘MSBTE’.
Write the program.(W-22)
6. Define thread priority ? Write default priority values and the methods to set and change
them.(W-22)
7. Write a program to print even and odd number using two threads with delay of 1000ms
after each number.(S-23)
8. Explain thread life cycle with neat diagram.(S-23)
9. Write a program that throws an exception called “NoMatchException” when a string is
not equal to “India”(W-23)
10.i) Explain Errors and its types in detail.
ii) Explain thread methods to set and getpriority(W-23)
11.Explain the concept of exception handling in Java and its importance in robust
programming. Provide an example to illustrate the implementation and benefits of
exception handling(S-24)
12.Define exception called ‘No Match Exception’ that is thrown when the password
accepted is not equal to ‘MSBTE’. Write the program(S-24)
13.