0% found this document useful (0 votes)
9 views9 pages

Summary Multiple Choice Questions

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 9

Summary multiple choice questions (Computer Programming)

1. _______ refers to the process of locating and removing the errors in a program

A. Analyzing
B. Correcting
C. Debugging
D. Executing
2. Who invented C++?
A. Dennis Ritchie
B. Ken Thompson
C. Brian Kernighan
D. Bjarne Stroustrup
3. What is C++?
A. C++ is an object-oriented programming language
B. C++ is a procedural programming language
C. C++ supports both procedural and object-oriented programming language
D. C++ is a functional programming language
4. Which of the following is the correct syntax of including a user defined header files in C++?
A. #include [userdefined]
B. #include “userdefined”
C. #include <userdefined.h>
D. #include <userdefined>
5. Which of the following is used for comments in C++?
A. /* comment */
B. // comment */
C. // comment
D. both // comment or /* comment */
6. The feature that allows the same operations to be carried out differently depending on the object is __

A. Polymorphism
B. Polygamy
C. Inheritane
D. Multitasking

7. Which of the following user-defined header file extension used in c++?


A. hg
B. cpp
C. h
D. hf
8. Variable declaration defines
A. only the name of the variable
B. an address in the memory
C. the type of data the variable can hold
D. both a) and c)
9. Which of the following is correct identifier in C++?
A. VAR_1234
B. $var_name
C. 7VARNAME
D. 7var_name
10. Which of the following correctly declares an array in C++?
A. array{10};
B. array array[10];
C. int array;
D. int array[10];
11. Which is more effective while calling the C++ functions?
A. call by object
B. call by pointer
C. call by value
D. call by reference
12. Who invented Java Programming?
A. Guido van Rossum
B. James Gosling
C. Dennis Ritchie
D. Bjarne Structure
13. Methods can be added to objects

A. to move objects
B. to define behavior
C. to rotate objects
D. to turn objects
14. Which statement is true about Java?
A. Java is a sequence-dependent programming language
B. Java is a code dependent programming language
C. Java is a platform-dependent programming language
D. Java is a platform-independent programming language
15. Which component is used to compile, debug and execute the java programs?
A. JRE
B. JIT
C. JDK
D. JVM
16. Which of the following cannot be part of a function declaration?

A. Function name
B. Function return type
C. Function parameter
D. Function definition
17. Which one of the following is not a Java feature?
A. Object-oriented
B. Use of pointers
C. Portable
D. Dynamic and Extensible
18. Which of these cannot be used for a variable name in Java?
A. identifier & keyword
B. identifier
C. keyword
D. none of the mentioned
19. What will be the output of the following Java code?

A. 32
B. 33
C. 24
D. 25
20. You have declared an integer pointer called point You have also declared an integer called number.
Which statement is the correct format?

A. point = number;
B. point = *number;
C. point = &number;
D. point = +number;
21. Which of the following is not an Object-Oriented programming concept in Java?
A. Polymorphism
B. Inheritance
C. Compilation
D. Encapsulation
22. What is not the use of “this” keyword in Java?
A. Referring to the instance variable when a local variable has the same name
B. Passing itself to the method of the same class
C. Passing itself to another method
D. Calling another constructor in constructor chaining
23. Which of the following is a type of polymorphism in Java Programming?
A. Multiple polymorphism
B. Compile time polymorphism
C. Multilevel polymorphism
D. Execution time polymorphism
24. What is Truncation in Java?
A. Floating-point value assigned to a Floating type
B. Floating-point value assigned to an integer type
C. Integer value assigned to floating type
D. Integer value assigned to floating type
25. What will be the output of the following Java program?

A. 1 2 3 4 5
B. 1 2 3 4
C. 1 2
D. 1 2 3
26. What is the extension of compiled java classes?
A. .txt
B. .js
C. .class
D. .java
27. What will be the output of the following Java program?
A. 9.0
B. 8.0
C. 4.0
D. 2.0
28. Which of these statements is incorrect about Thread?
A. start () method is used to begin execution of the thread
B. run() method is used to begin execution of a thread before start() method in special cases
C. A thread can be formed by implementing Runnable interface only
D. A thread can be formed by a class that extends Thread class
29. Which of these keywords are used for the block to be examined for exceptions?
A. check
B. throw
C. catch
D. try
30. An applet program can

A. draw pictures on web page


B. play sounds, videos
C. create new window and draw in it
D. all of the above
31. Java is best suitable for developing

A. network protocols
B. employee management sysytem
C. large software
D. library management system
32. Which of the following methods is invoked first in executing an applet program?

A. init()
B. start()
C. pain()
D. stop()
33. Which of the following cannot be supported by java programming?

A. Single inheritance
B. Application programming interface
C. Header files
D. Encapsulation
34. Which one of the following is not an access modifier?
A. Protected
B. Void
C. Public
D. Private
35. Which class provides system independent server-side implementation?
A. Server
B. ServerReader
C. Socket
D. ServerSocket
36. Which of the following is true about servlets?
A. Servlets can use the full functionality of the Java class libraries
B. Servlets execute within the address space of web server, platform independent and uses
the functionality of java class libraries
C. Servlets execute within the address space of web server
D. Servlets are platform-independent because they are written in java
37. Which one acts as communication endpoint between applications?

A. IP Address
B. Port number
C. Socket
D. Uniform Resource Locator
38. Give the abbreviation of AWT?

A. Applet Windowing Toolkit


B. Abstract Windowing Toolkit
C. Absolute Windowing Toolkit
D. None of the above
39. Which of the following names must start always in upper case?
A. Object name
B. Class name
C. Variable name
D. Method name
40. The output of the following Java program will be

A. 1
B. 2
C. 0
D. 3
41. Give the abbreviation of AWT?

A. Applet Windowing Toolkit


B. Abstract Windowing Toolkit
C. Absolute Windowing Toolkit
D. None of the above
42. Which of these class is used to encapsulate IP address and DNS??
A. DatagramPacket
B. URL
C. InetAddress
D. ContentHandler
43. What is multithreaded programming?

A. It’s a process in which two different processes run simultaneously


B. It’s a process in which two or more parts of same process run simultaneously
C. It’s a process in which many different processes are able to access same information
D. It’s a process in which a single process can access information from many sources
44. Which of the following protocol follows connection less service?

A. TCP
B. TCP/IP
C. UDP
D. HTTP
45. Which of the following hosts Java web applications?

A. Tomcat
B. Eclipse
C. NetBeans
D. JDK
46. Thread priority in Java is?

A. Integer
B. Float
C. Double
D. Long
47. Which of the following is not true?

A. Passing by value, the argument is read-only


B. Passing by reference, the parameter is a local variable
C. The argument passed by value may be a constant or a variable
D. The argument passed by reference must be a variable
48. Inheritance is the principle that

A. Classes with the same name must be derived from one another
B. Knowledge of a general category can be applied to more specific objects
C. C++ functions may be used only if they have logical predecessors
D. One function name may invoke different methods
49. A function that is called automatically each time an object is created is a(n)

A. Constructor
B. Contractor
C. Builder
D. Architect
50. An expression contains relational, assignment and arithmetic operators. In the absence of parentheses,
the order of evaluation will be

A. Assignment, relational, arithmetic


B. Arithmetic, relational, assignment
C. Relational, arithmetic, assignment
D. Assignment, arithmetic, relational
Answer for Computer Programming questions

1.C 6.A 11.D 16.D 21.C 26.C 31.A 36.B 41.C 46.C

2.D 7.C 12.B 17.B 22.B 27.B 32.A 37.C 42.B 47.B

3.C 8.D 13.B 18.C 23.B 28.B 33.C 38.B 43.C 48.A

4.D 9.A 14.D 19.A 24.B 29.D 34.B 39.C 44.A 49.B

5.D 10.D 15.C 20.C 25.D 30.D 35.D 40.B 45A 50.C

You might also like