Vous êtes sur la page 1sur 6

JAVA MOCK TEST

1] OOP treats what as a critical element in program development and does not allow it to flow freely around the system. 1) Procedures 2) Action 3) Data 4) Method 2] Dynamic binding is associated with 1) Polymorphism 2) Inheritance 3) Both Option1 and Option2 4) Neither Option1 and Option2 3) What are user define data types and behave like built-in types of a programming language. 1) Objects 2) Methods 3) Templates 4) Classes 4] In OOP, the concept of Polymorphism is 1) Reusability 2) Ability to take more than one form 3) Sharing of data 4) Hiding of data 5] In OOP the concept of representing essential features without including the background details is called as 1) Data Hiding 2) Data Abstraction 3) Inheritance 4) Dynamic Binding 6] In OOP, the concept of wrapping data and methods into a single unit called classes is known as 1) Data Abstraction 2) Inheritance 3) Polymorphism 4) Encapsulation 7] Which of the following is NOT True with respect to OOP 1) Upgrading systems is difficult 2) Multiple objects co-exists without any interference 3) Secure Programs can be built 4) Software development is made easy 8] In OOP approach programs are divided into 1) Objects 2) Methods 3) Functions 4) Procedures 9] In OOP, the concept of Inheritance provides us with

1) Insulation 2) Linking 3) Reusability 4) Sharing 10] What does message passing involve in OOP 1) It involves specifying name of the object 2) It involves name of the method 3) It involves the information to be sent 4) All of the options 1,2,3 11] Which of the following is NOT one of the programming techniques. 1) Structured programming 2) Modular programming 3) Bottom-up programming 4) Destructred programming 12] Which of the following is TRUE with respect to Dynamic Binding 1) Linking of a procedure call to the code to be executed in response to the call 2) Code associated with a given procedure is not know until time of the call at run time 3) It is associated with inheritance and polymorphism 4) All of the options 1,2,3 13) In OOP, the concept of wrapping data and methods into a single unit called classes is known as 1) Data Abstraction 2) Inheritance 3) Polymorphism 4) Encapsulation 14] In OOP process by which objects of one class acquire the properties of objects of another class is 1) Inheritance 2) Polymorphism 3) Encapsulation 4) Abstraction 15] Which of the following type of applications OOP can be useful for 1) Real-time Systems 2) Simulation and modelling 3) Decision Support and office automation systems 4) All of the options 1,2,3 16] What was Java originally called as 1) Object C 2) Object Basic

3) Oak 4) Pascal 17] Java is Distributed-language, What statement explain this feature 1) Java programs can be easily moved from one computer system to another 2) Java systems verify memory access and virus 3) Java can be used to create applications on the networks 4) It provides many safeguards to ensure reliable code 18] Java is Robust, What statement explain this feature 1) Java programs can be easily moved from one computer system to another 2) Java systems verify memory access and virus 3) Java can be used to create applications on the networks 4) It provides many safeguards to ensure reliable code 19] Identify line numbers where errors occur in the following code 1 class sample 2{ 3 public static void main(String[], args[]) 4{ 5 System.out.println(Hello); 6} 7 }; 1) Lines 3,7 2) Line 3 3) Line 7 4) Line 5 20] Identify line numbers where errors occur in the following code 1 Class sample 2{ 3 public static void main(string args[]) 4{ 5 int m=10; 6{ 7 int m=20; 8} 9} 10 } 1) Lines 1,3,7 2) Line 3,5,7 3) Line 5,7 4) Line 3,5 21] Identify line numbers where compile errors occur in the following code

1 class sample 2{ 3 public static void display() 4{ 5 byte x=212; 6 float f=100.12; 7 System.out.println("Value of f="+f); 8 System.out.println("Value of x="+x); 9} 10 } 1) Lines 5,6,7,8 2) Line 5,6 3) Line 7,8 4) Line 5,6 22] What is the result if the code of statements are executed int result = (2*(5-8)*(5-5)+10)*2; 1) 8 2) 20 3) 14 4) 0 23] What is the value of ans if the code of statements are executed int i = 42+45-48-5; int j = 5+5-8+2; int ans = i%j; 1) 2 2) 8 3) 34 4) 12 24] What is the value of result if the code of statements are executed int result = 42+45-48-5-15+20*2; 1) 59 2) 68 3) 146 4) 134 25] What will be the output of the following code, if executed with command line arguments as follows java cmdline Java is wonderful class cmdline { public static void main(String args[]) { for(int i=1;i<args.length;i++) { System.out.print(args[i]); if(i!=args.length) System.out.print( );

} System.out.println(); } } 1) Java 2) Java is 3) is wonderful 4) cmdline Java is wonderful 26] What will be the output of the following code, if executed with command line arguments as follows java cmdline Java is wonderful class cmdline { public static void main(String args[]) { System.out.println(Number of arguments : +args.length); for(int i=0;i<args.length;i++) System.out.print(args[i]+ ); } } 1) Number of arguments : 4 Java is wonderful 2) 4 cmdline Java is wonderful 3) Number of arguments : 3 Java is wonderful 4) cmdline Java is wonderful 27] In 1) 2) 3) 4) OOP approach programs are divided into Objects Methods Functions Procedures

28] In OOP, the concept of wrapping data and methods into a single unit called classes is known as 1) Data Abstraction 2) Inheritance 3) Polymorphism 4) Encapsulation 29] Which of the following feature in C is NOT included in Java 1) Break statement 2) Continue statement 3) Pointer type 4) Primitive data types