Tag: programming languages

Questions Related to programming languages

  1. Clickonce deployment

  2. User access control(UAC) support

  3. Improved performance

  4. all of the above

  5. none of the above


Correct Option: D
  1. BasicHttpBinding

  2. WSHttpBinding

  3. MSHttpBinding

  4. NetMsmqBinding


Correct Option: A,B,D
  1. Subsequent statements in the current processing blocks are executed

  2. There is an error message

  3. Program gets terminated

  4. Subsequent statements in the current processing blocks are not executed


Correct Option: D

Which of the following, if inserted at the comment //Here will allow the code to compile and run without error class MyCast{} public class Base extends MyCast{ static boolean b1=false; static int i = 1; static double d = 10.1; public static void main(String argv[]){ MyCast m = new MyCast (); Base b = new Base(); //………..Here }}

  1. b=m;

  2. m=b;

  3. d =i;

  4. b1 =i;


Correct Option: B

AI Explanation

To answer this question, we need to understand the concept of inheritance and typecasting.

The given code defines two classes: MyCast and Base. The class Base extends the class MyCast, indicating that Base inherits from MyCast.

In the main method, two objects are instantiated: m of type MyCast and b of type Base. Now, let's go through each option to determine which one allows the code to compile and run without error when inserted at the comment //………..Here.

Option A) b = m; This option attempts to assign m to b. However, m is of type MyCast, and b is of type Base. Since Base inherits from MyCast, we can assign a Base object to a MyCast reference, but not the other way around. Therefore, this option is incorrect.

Option B) m = b; This option attempts to assign b to m. Since Base extends MyCast, a Base object can be treated as a MyCast object. Therefore, this option is correct.

Option C) d = i; This option attempts to assign the value of i to d. However, i is of type int, and d is of type double. The assignment may result in a loss of precision, which is not allowed without explicit casting. Therefore, this option is incorrect.

Option D) b1 = i; This option attempts to assign the value of i to b1. However, i is of type int, and b1 is of type boolean. The types are not compatible, and this assignment is not allowed. Therefore, this option is incorrect.

The correct answer is Option B) m = b;. This option allows the code to compile and run without error because a Base object can be assigned to a MyCast reference.

  1. Code will give compile time error

  2. Code will give runtime error

  3. Code will print "Equal"

  4. Code will print "Not Equal" ==


Correct Option: D

Contents in AQuestion.java private class AQuestion { public void method(Object o){ System.out.println("Object Verion"); } public void method(String s){ System.out.println("String Version"); } public static void main(String args[]){ AQuestion question = new AQuestion(); question.method(null); } }

  1. The code does not compile.

  2. The code compiles cleanly and shows “Object Version”.

  3. The code compiles cleanly and shows “String Version”

  4. The code throws an Exception at Runtime.


Correct Option: A

Can threads be killed manually

  1. Yes

  2. No

  3. Dont know

  4. May Be


Correct Option: A