0

programming languages Online Quiz - 270

Description: programming languages Online Quiz - 270
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

First broswer to incorporate Java technology is

  1. Internet explorer

  2. Safari

  3. Firefox

  4. Netscape navigator


Correct Option: D

'javac' is the loader for Java applications

  1. True

  2. False


Correct Option: B

Which one of the following is true

  1. The JDK and SDK holds the same features with different name

  2. The JDK forms an extended subset of a SDK

  3. The SDK forms an extended subset of a JDK

  4. None


Correct Option: B

'java' command converts source code into Java bytecode

  1. True

  2. False


Correct Option: B

'javadoc' component is part of JDK from Sun microsystems

  1. True

  2. False


Correct Option: A

JVM is an instance of JRE (Java runtime environment)

  1. True

  2. False


Correct Option: A

what is Manifest file?

  1. the meta data file that contains name-value pairs organized in different sections

  2. specific file contained within a JAR archive

  3. the manifest file is named MANIFST.MFT

  4. All the above


Correct Option: A,B

public class AQuestion{ public static void main(String args[]){ System.out.println("Before Try"); try{ } catch(Throwable t){ System.out.println("Inside Catch"); } System.out.println("At the End"); } }

  1. Compiler error complaining about the catch block where no IOException object can ever be thrown.

  2. Compiler error - IOException not found. It must be imported in the first line of the code.

  3. No compiler error. The lines “Before Try” and “At the end” are printed on the screen.

  4. None of Above


Correct Option: A,B,C,D

AI Explanation

To answer this question, let's go through each option:

Option A) Compiler error complaining about the catch block where no IOException object can ever be thrown. This option is incorrect. The catch block doesn't specify any specific exception type, so it can catch any type of exception or throwable object.

Option B) Compiler error - IOException not found. It must be imported in the first line of the code. This option is incorrect. The code doesn't throw any IOException, so there is no need to import it.

Option C) No compiler error. The lines “Before Try” and “At the end” are printed on the screen. This option is correct. Since there are no statements inside the try block, the code will execute the statements after the try-catch block. Therefore, the output will be "Before Try" followed by "At the End".

Option D) None of the Above This option is incorrect since option C is correct.

The correct answer is C. No compiler error. The lines “Before Try” and “At the end” are printed on the screen because there are no statements inside the try block.

The class java.lang.Exception

  1. Is public

  2. Extends Throwable

  3. Implements Throwable

  4. Is serializable


Correct Option: A

Which of the following visual studio 2008 features are deployment enhancements?

  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

ASMX and WSE do not provide efficient ways for providing security,routing,reliable messaging and transaction handling.

  1. True

  2. False


Correct Option: A

The default bindings that WCF uses to automatically configure a service are...

  1. BasicHttpBinding

  2. WSHttpBinding

  3. MSHttpBinding

  4. NetMsmqBinding


Correct Option: A,B,D

ASMX and WSE technologies do not provide interoperable model.

  1. True

  2. False


Correct Option: B

If CHECK statement is outside the loop structure and if the condition fails?

  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.

Which of the following lines will compile without error? String s = "Hello"; long l = 99; double d = 1.11; int i = 1; int j = 0;

  1. j= i<

  2. j= i<

  3. j=i<

  4. j=i<


Correct Option: B

if("String".toString() == "String") System.out.println("Equal");else System.out.println("Not Equal");

  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

if("String".toString() == "String") System.out.println("Equal"); else System.out.println("Not Equal");

  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
- Hide questions