Object Oriented Programming in Java - Unit Wise Questions
1.
i) Which one of the following is not a valid java bitwise operator?
a) >> b) << c) >>> d) <<<
2. Define OOP. Explain features of Object Oriented Programming Language. [1 + 4]
3. Explain different types of control statements used in java. [5]
1.
ii) Which one of the following keyword is used to declare an exception?
a) throws b) throw c) try d) catch
1.
iii) Which of these is an incorrect array declaration?
a) int ary[] = new int[5]; b) int[] ary = new int[5]; c) int ary = int[5] new; d) int ary[]; ary = new int[5];
4. Define Abstract Class. Explain different types of Access controls available in java.[1 + 4]
5. Define method overriding? Write any program to implement concept of multiple inheritance in Java. [1 + 4]
1.
iv) Which one of the following access specifier is appropriate for members of superclass to
access only from subclass?
a) private b) protected c) public d) default
6. Why it is important to handle exception in java? Write a program to illustrate the use of exception handling. [1 + 4]
1.
v) Which one of the following is not a collection class defined in java?
a) Linked List b) Hash Set c) Tree Set d) Graph Set
1.
vi) Which one of the following inheritance is best implanted using interface in java?
a) single inheritance b) multi-level inheritance c) multiple inheritance d) hierarchical inheritance
7. Define the use of static keyword. Write any four String methods used in java with example. [1 + 4]
8. Define super, final and this keyword in java. Explain the concept of MVC in brief. [1 + 1 + 1 + 2]
1.
vii) Which one of the following method is called only once during the run time of your applet?
a) stop() b) paint() c) init() d) start()
1.
viii) Which of these method of class String is used to compare two String objects for their equality?
a) equals() b) Equals() c) is Equal() d) Is Equal()
1.
ix) What is the default value of priority variable MIN_PRIORITY and MAX_PRIORITY?
a) 0 & 63 b) 1 & 10 c) 0 & 1 d) 1 & 32
1.
x) Which one of the following is not java swing container?
a) Panel b) Tabbed Pane c) Scroll Pane d) Scroll bar
9. a) Define multithreading. Write a java program to show the inter-thread communication. [1 + 4]
b) Define Stream. Write a program in java to copy the content from one file to another. [1 + 4]
10. a) Define Collection Class. Explain different Wrapper classes and associated methods in java. [1+4]
b) Define AWT. Explain different types of Layout Managers in java. [1 + 4]
11. a) List and explain any five swing controls with their uses. [5]
b) Define JDBC. Write a program to display all records from a table of database. [1 + 4]