Вы находитесь на странице: 1из 8

www.jntuworld.com Code No: Set No. 1 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD II B.Tech. II Sem.

, I Mid-Term Examinations, Jan/Feb 2011 OBJECT ORIENTED PROGRAMMING Objective Exam Name: ______________________________ Hall Ticket No. A I 1. Choose the correct alternative: What is the argument type of programs main() method ? (a)Character array (b)String array (c)String Which operator is used to create and concatenate string? (a)++ (b)&& (c)& (d)+ Which is used to get the value of the instance variables ? (a).(Dot) (b)>> (c)<< (d)-> Identify the true statements about finalization. i)A class may have only one finalize method ii)Finalizers are mostly used with simple classes iii)Finalizer overloading is not allowed (a)i&ii&iii (b)i&ii (c)i&iii [ (d)Character [ ] ]

Answer All Questions. All Questions Carry Equal Marks. Time : 20 Min. Marks: 10.

2.

3.

4.

5.

Which of the following statements correctly describes an interface? [ ] (a)Its a type of abstract class (b)Its a superclass (c)Its a concreteclass (d)Its finalclass How are the variables declared? (a)beginning of method definition (b)any where in the method definition. (c)anywhere in the method definition and should be initialized. (d)beginning of method definition and should be initialized

6.

7.

What happens when the following program is compiled and executed without the arguments. Select the one correct answer. Class test { public static void main(String args[]) { if(args.length>0) System.out.println(args.length); } } [ ] (a)The program compiles and runs and prints 0 (b)The program compiles and runs but does not print anything. (c)Does not compile (d)The program compiles and runs and prints 1 Cont.2

T N

W U

R O
(d)ii&iii

D L

www.jntuworld.com

www.jntuworld.com Code No: 8. :2: Set No. 1

What is a constructor? [ ] (a)constructor is a special kind of method that determines how an object is initialized when destroyed. (b)A constructor is a special kind of method that determines how an object is initialized. (c) A constructor is a special kind of method that determines how an object is initialized when created. (d)A constructor is a special kind of method that determines how an object is initialized when called. The default package imported by all java programs is (a)java.lang (b)java.swing (c)java.awt Which of the following is illegal: (a)Float f=45.0; (b)float f=45.0; Fill in the blanks: If you dont implement all the methods of an interface while implementing,____________ specifier used for the class. The other name for conditional operator is___________. [ (d)java.applet [ (c)double d=45.0; (d)int i=32; ] ]

9.

10. II 11.

12. 13. 14. 15. 16. 17. 18. 19. 20.

______________ used to separate the hierarchy of the class while declaring an import statement. ___________ operator creates a single instance named class and returns a reference to that object. Extension of a file created by compiling a source file in java is___________. ________ the argument type of programs main() method?

________ access modifier should be used when implementing interface methods Interfaces are used to achieve __________

___________is the default value of float primitive type? The Random class belongs to_________ package

T N

W U
-oOo-

R O

D L

www.jntuworld.com

www.jntuworld.com Code No: Set No. 2 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD II B.Tech. II Sem., I Mid-Term Examinations, Jan/Feb 2011 OBJECT ORIENTED PROGRAMMING Objective Exam Name: ______________________________ Hall Ticket No. A I 1. Choose the correct alternative: Identify the true statements about finalization. i)A class may have only one finalize method ii)Finalizers are mostly used with simple classes iii)Finalizer overloading is not allowed (a)i&ii&iii (b)i&ii (c)i&iii

Answer All Questions. All Questions Carry Equal Marks. Time : 20 Min. Marks: 10.

[ (d)ii&iii

2.

Which of the following statements correctly describes an interface? [ ] (a)Its a type of abstract class (b)Its a superclass (c)Its a concreteclass (d)Its finalclass How are the variables declared? (a)beginning of method definition (b)any where in the method definition. (c)anywhere in the method definition and should be initialized. (d)beginning of method definition and should be initialized

3.

4.

What happens when the following program is compiled and executed without the arguments. Select the one correct answer. Class test { public static void main(String args[]) { if(args.length>0) System.out.println(args.length); } } [ ] (a)The program compiles and runs and prints 0 (b)The program compiles and runs but does not print anything. (c)Does not compile (d)The program compiles and runs and prints 1

T N

W U

R O

D L

5.

What is a constructor? [ ] (a)constructor is a special kind of method that determines how an object is initialized when destroyed. (b)A constructor is a special kind of method that determines how an object is initialized. (c) A constructor is a special kind of method that determines how an object is initialized when created. (d)A constructor is a special kind of method that determines how an object is initialized when called. The default package imported by all java programs is (a)java.lang (b)java.swing (c)java.awt Which of the following is illegal: (a)Float f=45.0; (b)float f=45.0; [ (d)java.applet [ (c)double d=45.0; (d)int i=32; Cont.2 ] ]

6.

7.

www.jntuworld.com

www.jntuworld.com Code No: :2: Set No. 2

8.

What is the argument type of programs main() method ? (a)Character array (b)String array (c)String Which operator is used to create and concatenate string? (a)++ (b)&& (c)& (d)+ Which is used to get the value of the instance variables ? (a).(Dot) (b)>> (c)<< (d)-> Fill in the blanks:

[ (d)Character [

9.

10.

II 11. 12. 13. 14. 15. 16. 17. 18.

___________ operator creates a single instance named class and returns a reference to that object. Extension of a file created by compiling a source file in java is___________. ________ the argument type of programs main() method?

________ access modifier should be used when implementing interface methods Interfaces are used to achieve __________

___________is the default value of float primitive type? The Random class belongs to_________ package

If you dont implement all the methods of an interface while implementing,____________ specifier used for the class. The other name for conditional operator is___________. ______________ used to separate the hierarchy of the class while declaring an import statement.

19. 20.

T N

W U
-oOo-

R O

D L

www.jntuworld.com

www.jntuworld.com Code No: Set No. 3 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD II B.Tech. II Sem., I Mid-Term Examinations, Jan/Feb 2011 OBJECT ORIENTED PROGRAMMING Objective Exam Name: ______________________________ Hall Ticket No. A I 1. Choose the correct alternative: How are the variables declared? (a)beginning of method definition (b)any where in the method definition. (c)anywhere in the method definition and should be initialized. (d)beginning of method definition and should be initialized [ ]

Answer All Questions. All Questions Carry Equal Marks. Time : 20 Min. Marks: 10.

2.

What happens when the following program is compiled and executed without the arguments. Select the one correct answer. Class test { public static void main(String args[]) { if(args.length>0) System.out.println(args.length); } } [ ] (a)The program compiles and runs and prints 0 (b)The program compiles and runs but does not print anything. (c)Does not compile (d)The program compiles and runs and prints 1 What is a constructor? [ ] (a)constructor is a special kind of method that determines how an object is initialized when destroyed. (b)A constructor is a special kind of method that determines how an object is initialized. (c) A constructor is a special kind of method that determines how an object is initialized when created. (d)A constructor is a special kind of method that determines how an object is initialized when called. The default package imported by all java programs is (a)java.lang (b)java.swing (c)java.awt Which of the following is illegal: (a)Float f=45.0; (b)float f=45.0;

3.

4.

T N

W U

R O

D L

[ (d)java.applet [

5.

(c)double d=45.0;

(d)int i=32; [ (d)Character [ ] ]

6.

What is the argument type of programs main() method ? (a)Character array (b)String array (c)String Which operator is used to create and concatenate string? (a)++ (b)&& (c)& (d)+ Which is used to get the value of the instance variables ? (a).(Dot) (b)>> (c)<< (d)->

7.

8.

[ Cont.2

www.jntuworld.com

www.jntuworld.com Code No: :2: Set No. 3

9.

Identify the true statements about finalization. i)A class may have only one finalize method ii)Finalizers are mostly used with simple classes iii)Finalizer overloading is not allowed (a)i&ii&iii (b)i&ii (c)i&iii

[ (d)ii&iii

10.

Which of the following statements correctly describes an interface? [ (a)Its a type of abstract class (b)Its a superclass (c)Its a concreteclass (d)Its finalclass Fill in the blanks: ________ the argument type of programs main() method? ________ access modifier should be used when implementing interface methods Interfaces are used to achieve __________ ___________is the default value of float primitive type? The Random class belongs to_________ package

II 11. 12. 13. 14. 15. 16.

If you dont implement all the methods of an interface while implementing,____________ specifier used for the class. The other name for conditional operator is___________. ______________ used to separate the hierarchy of the class while declaring an import statement. ___________ operator creates a single instance named class and returns a reference to that object. Extension of a file created by compiling a source file in java is___________.

17. 18. 19. 20.

T N

W U
-oOo-

R O

D L

www.jntuworld.com

www.jntuworld.com Code No: Set No. 4 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD II B.Tech. II Sem., I Mid-Term Examinations, Jan/Feb 2011 OBJECT ORIENTED PROGRAMMING Objective Exam Name: ______________________________ Hall Ticket No. A I 1. Choose the correct alternative: What is a constructor? [ ] (a)constructor is a special kind of method that determines how an object is initialized when destroyed. (b)A constructor is a special kind of method that determines how an object is initialized. (c) A constructor is a special kind of method that determines how an object is initialized when created. (d)A constructor is a special kind of method that determines how an object is initialized when called. The default package imported by all java programs is (a)java.lang (b)java.swing (c)java.awt Which of the following is illegal: (a)Float f=45.0; (b)float f=45.0; [ (d)java.applet ]

Answer All Questions. All Questions Carry Equal Marks. Time : 20 Min. Marks: 10.

2.

3.

(c)double d=45.0;

(d)int i=32;

4.

What is the argument type of programs main() method ? (a)Character array (b)String array (c)String Which operator is used to create and concatenate string? (a)++ (b)&& (c)& (d)+

5.

6.

Which is used to get the value of the instance variables ? (a).(Dot) (b)>> (c)<< (d)-> Identify the true statements about finalization. i)A class may have only one finalize method ii)Finalizers are mostly used with simple classes iii)Finalizer overloading is not allowed (a)i&ii&iii (b)i&ii (c)i&iii

7.

8.

Which of the following statements correctly describes an interface? [ ] (a)Its a type of abstract class (b)Its a superclass (c)Its a concreteclass (d)Its finalclass How are the variables declared? (a)beginning of method definition (b)any where in the method definition. (c)anywhere in the method definition and should be initialized. (d)beginning of method definition and should be initialized [ ]

T N

W U

R O
(d)ii&iii

(d)Character

D L

9.

Cont.2

www.jntuworld.com

www.jntuworld.com Code No: 10. :2: Set No. 4

What happens when the following program is compiled and executed without the arguments. Select the one correct answer. Class test { public static void main(String args[]) { if(args.length>0) System.out.println(args.length); } } [ ] (a)The program compiles and runs and prints 0 (b)The program compiles and runs but does not print anything. (c)Does not compile (d)The program compiles and runs and prints 1 Fill in the blanks: Interfaces are used to achieve __________ ___________is the default value of float primitive type? The Random class belongs to_________ package

II 11. 12. 13. 14.

If you dont implement all the methods of an interface while implementing,____________ specifier used for the class. The other name for conditional operator is___________. ______________ used to separate the hierarchy of the class while declaring an import statement. ___________ operator creates a single instance named class and returns a reference to that object. Extension of a file created by compiling a source file in java is___________. ________ the argument type of programs main() method? ________ access modifier should be used when implementing interface methods

15. 16. 17. 18. 19. 20.

T N

W U
-oOo-

R O

D L

www.jntuworld.com

Вам также может понравиться