solutions adda
Loading...
Question 1 |
A software engineer is required to implement two sets of algorithms for a single set of matrix operations in an object oriented programming language; the two sets of algorithms are to provide precisions of 10-3 and 10-6, respectively. She decides to implement two classes, Low Precision Matrix and High Precision Matrix, providing precisions 10-3 and 10-6 respectively. Which one of the following is the best alternative for the implementation?
A | S1 |
B | S2 |
C | S3 |
D | S4 |
Question 2 |
Run-time polymorphism is achieved by
A | friend function |
B | virtual function
|
C | operator overloading |
D | function overloading |
Question 3 |
The operator that cannot be overloaded is
A | ++ |
B | :: |
C | 0 |
D | ~ |
Question 4 |
The keyword friend does not appear in
A | the class allowing access to another class |
B | the class desiring access to another class |
C | the private section of a class
|
D | the public section of a class |
Question 5 |
A | Type |
B | Set of operations on that type |
C | How the type is implemented |
D | (A) and (B) |
Question 6 |
A | User interface class |
B | System class |
C | Business domain class |
D | Process class |
Question 7 |
A | C++ |
B | Java |
C | Both C++ and Java |
D | None |
Question 8 |
A | Private and protected members |
B | Public members only |
C | Private members only |
D | None |
Question 9 |
The C++ statement cout <<(0 ==0) will
A | Outputs as 0 |
B | Outputs as 1 |
C | Generate error at the time of compilation
|
D | Generate run time |
Question 10 |
A | Copy constructor |
B | Friend constructor |
C | Default constructor |
D | Parameterized constructor |
Question 11 |
A | function |
B | class |
C | object |
D | operator function |
Question 12 |
A | same as object
|
B | same as member |
C | same as class |
D | same as function |
Question 13 |
A | Classname objectname;
|
B | Class classname obj objectname; |
C | Class classname obj objectname; |
D | Classname obj objectname |
Question 14 |
A | 1 |
B | 2 |
C | 3 |
D | as many as required |
Question 15 |
A | Serialization |
B | Garbage collection |
C | File Filtering |
D | All the given options |
Question 16 |
A | Returns a pointer to a variable
|
B | Creates a variable called new |
C | Obtains memory for a new variable |
D | Tells how much memory is available |
Question 17 |
A | Refer to current class object |
B | Refer to static method of the class
|
C | Refer to parent class object |
D | Refer to static variable of the class |
Question 18 |
A | Remove Method Invocation (RMI) |
B | Remote Procedure Calls (RPC) |
C | Multicast sockets |
D | Remote Method Invocation (RMI) or Remote Procedure Calls (RPC) |
Question 19 |
A | Private |
B | Protected |
C | Public |
D | Friend |
Question 20 |
A | Java applets can not be written in any programming language |
B | An applet is not a small program |
C | An applet can be run on its own |
D | Applets are embedded in another applications |
Question 21 |
A | Member function of class B can access protected data of class A |
B | Member function of class access public data of class A |
C | Member function of class B cannot access private data of class A |
D | Object of derived class B can access public base class data |
Question 22 |
A | (a) and (b) only |
B | (a), (b) and (c) only |
C | (a), (b) and (d) only |
D | (b), (c) and (d) only |
Question 23 |
A | Class loader only |
B | Class loader and Java Interpreter |
C | Class loader, Java Interpreter and API |
D | Java Interpreter only |
Question 24 |
A | Date::Date(int dd) {/*...*/} |
B | explicit Date::Date(int dd) {/*...*/} |
C | Such a constructor cannot be defined |
D | Constructor always has to be defined inside the class |
Question 25 |
A | (A)-(I), (B)-(II), (C)-(III), (D)-(IV) |
B | (A)-(II), (B)-(I), (C)-(III), (D)-(IV) |
C | (A)-(III), (B)-(I), (C)-(II), (D)-(IV) |
D | (A)-(III), (B)-(I), (C)-(IV), (D)-(II) |
Question 26 |
A | To enable the JVM to make call to the main( ), as class has not been instantiated. |
B | To enable the JVM to make call to the main( ), as class has not been inherited. |
C | To enable the JVM to make call to the main( ), as class has not been loaded. |
D | To enable the JVM to make call to the main( ), as class has not been finalized. |
Question 27 |
A | Serializable Interface |
B | Utilization Interface |
C | Threadable Interface |
D | Recognizable Interface |
Question 28 |
A | f1.setClear(true); |
B | f1.setVisible(true); |
C | f1.setlook(true); |
D | f1.setclean(true); |
Question 29 |
A | Single try can have multiple associated catch with it |
B | A Single Catch can have multiple try associated with it |
C | Finally block execute only when the class is inherited |
D | For a given exception, multiple catch can execute |
Question 30 |
A | Overloading and linking |
B | Overriding and linking |
C | Reusability and data-hiding |
D | Overloading and Overriding |
Question 31 |
A | Both the statements (a) and (b) are correct. |
B | Neither of the statements (a) and (b) are correct |
C | Statement (a) is correct and (b) is incorrect |
D | Statement (a) is incorrect and (b) is correct. |
Question 32 |
A | terminate( ) |
B | unexpected( ) |
C | abort( ) |
D | kill( ) |
Question 33 |
A | The member functions of the class generating friendship can access the members of the friend class. |
B | All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship. |
C | Class friendship is reciprocal to each other. |
D | There is no such concept. |
Question 34 |
A | Overloads |
B | Friendships |
C | Inherits |
D | Overrides |
Question 35 |
A | A function can only be declared a friend by a class itself. |
B | Friend functions are not members of a class, they are associated with it. |
C | Friend functions are members of a class. |
D | It can have access to all members of the class, even private ones. |
Question 36 |
A | Byte and char |
B | Long and char |
C | Char and float |
D | Byte and float |
Question 37 |
A | A,b and d |
B | B,c and d |
C | A,b and c |
D | C and d |
Question 38 |
A | Before a variable can be used, it must be declared |
B | Variable are allocated values through the use of assignment statements |
C | When a variable is declared, C++ allocates storage for the variable and puts an unknown value inside it. |
D | We can use a variable even if it is not declared. |
Question 39 |
A | Each public member in the base class is protected in the derived class |
B | Each protected member in the base class is protected in the derived class |
C | Each private member in the base class is private in the derived class |
D | Each private member in the base class is visible in the derived class |
Question 40 |
A | Protected and public data only in C and B |
B | Protected and public data only in C |
C | Private data in A and B |
D | Protected data in A and B |
Question 41 |
A | Polymorphism |
B | Single inheritance |
C | Multilevel inheritance |
D | Message passing |
Question 42 |
A | Public |
B | Private |
C | Protected |
D | Mandatory to specify |
Question 43 |
A | 1 byte |
B | 2 byte |
C | 4 byte |
D | 8 byte |
Question 44 |
A | Student student(){} |
B | Private final student(){} |
C | Student(student s){} |
D | Void student(){} |
Question 45 |
A | "is a kind of" relationship |
B | "has a" relationship |
C | "want to be" relationship |
D | "contains" of relationship |
Question 46 |
What is the output of the following JAVA program ?
class simple { public static void main(String[] args) { simple obj = new simple(); obj.start(); } void start() { long [] P = {3, 4, 5}; long [] Q = method (P); System.out.print (P[0] + P[1] + P[2]+”:”); System.out.print (Q[0] + Q[1] + Q[2]); } long [] method (long [] R) { R [1] = 7; return R; } } //end of class
A | 12 : 15 |
B | 15 : 12 |
C | 12 : 12 |
D | 15 : 15 |
Question 47 |
In Java, which of the following statements is/are True ?
A | S1 and S2 only |
B | S1 and S3 only |
C | S2 and S3 only |
D | All of S1, S2 and S3
|
Question 48 |
Which of the following statements is/are True ?
P : C programming language has a weak type system with static types. Q : Java programming language has a strong type system with static types. Code :A | P only |
B | Q only |
C | Both P and Q |
D | Neither P nor Q
|
Question 49 |
A | There is syntax error in line no. 1 |
B | There is syntax errors in line nos. 1 & 6 |
C | There is syntax error in line no. 8 |
D | There is syntax error in line no. 6 |
Question 50 |
A | extern |
B | static |
C | volatile |
D | const |