0
Alien head

programming languages Online Quiz - 11

Description: programming languages Online Quiz - 11
Number of Questions: 20
Created by:
Tags: programming languages

JAX-RS stands for Java API for RESTful Web Services

  1. True

  2. False

Answer: 1

JAX-WS stands for Java API for XML Web Services

  1. True

  2. False

Answer: 1

JSSE stands for Java Socket Service Extension

  1. True

  2. False

Answer: 2

JDO stands for Java Data Objects

  1. True

  2. False

Answer: 1

JCE stands for Java Communication Extension

  1. True

  2. False

Answer: 2

JCA stands for Java Communications API

  1. True

  2. False

Answer: 1

JAF stands for Java Activation Framework

  1. True

  2. False

Answer: 2

JAIN stands for Java Integrated Networks

  1. True

  2. False

Answer: 1

What will be the output of the program?

public class WrapTest {
 public static void main(String[] args) {
  int result = 0;
  short s = 42;
  Long x = new Long("42");
  Long y = new Long(42);
  Short z = new Short("42");
  Short x2 = new Short(s);
  Integer y2 = new Integer("42");
  Integer z2 = new Integer(42);
  if (x == y) /* Line 13 */ result = 1;
  if (x.equals(y)) /* Line 15 */ result = result + 10;
  if (x.equals(z)) /* Line 17 */ result = result + 100;
  if (x.equals(x2)) /* Line 19 */ result = result + 1000;
  if (x.equals(z2)) /* Line 21 */ result = result + 10000;
  System.out.println("result = " + result);
 }
}
  1. result = 1

  2. result = 10

  3. result = 11

  4. result = 11010

Answer: 2

In which all cases does an exception gets generated. Select the two correct answers. int i = 0, j = 1;

  1. if((i == 0) || (j/i == 1))

  2. if((i == 0) | (j/i == 1))

  3. if((i != 0) && (j/i == 1))

  4. if((i != 0) & (j/i == 1))

Answer: 2,4

What will be the output of the program?

public class Foo {
 Foo() {
  System.out.print("foo");
 }
 class Bar {
  Bar() {
   System.out.print("bat");
  }
  public void go() {
   System.out.print("hi");
  }
 } /* class Bar ends */
 public static void main(String[] args) {
  Foo f = new Foo();
  f.makeBar();
 }
 void makeBar() {
  (new Bar() {}).go();
 }
} /* class Foo ends */
  1. Compilation fails.

  2. An error occurs at runtime.

  3. It prints "foobarhi"

  4. It prints "barhi"

Answer: 3

What will be the output of the program?

public abstract class AbstractTest {
 public int getNum() {
  return 45;
 }
 public abstract class Bar {
  public int getNum() {
   return 38;
  }
 }
 public static void main(String[] args) {
  AbstractTest t = new AbstractTest() {
   public int getNum() {
    return 22;
   }
  };
  AbstractTest.Bar f = t.new Bar() {
   public int getNum() {
    return 57;
   }
  };
  System.out.println(f.getNum() + " " + t.getNum());
 }
}
  1. 57 22

  2. 45 38

  3. 45 57

  4. An exception occurs at runtime.

Answer: 1

We can initialize following type of variables in class declaration.

  1. static

  2. const

  3. extern

  4. none

Answer: 4

How many differnces we can find between structures in C and C++ ?

  1. 1

  2. No difference

  3. 2

  4. 5

Answer: 1

How many differnces are there between structures in C and C++ ?

  1. 1

  2. No difference

  3. 2

  4. 5

Answer: 4

What is the memory of a class that contains niether data members nor member functions ?

  1. 0 bytes

  2. 1 bit

  3. same as sizeof(int)

  4. 1 byte

Answer: 4

Following functionality in C++ violates the encapsulation.

  1. Pointers

  2. Friend Function

  3. Access Specifiers

  4. None

Answer: 2

What makes C++ to support function overloading ?

  1. Polymorphism

  2. Inheritance

  3. Name Mangling

  4. Function Signature

Answer: 3

We can assign NULL to const pointer after initializing once.

  1. True

  2. False

Answer: 2

Libname statements can be used to create excel workbooks

  1. True

  2. False

Answer: 1
+ View questions