programming languages Online Quiz - 11
Description: programming languages Online Quiz - 11 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
Libname statements can be used to create excel workbooks
We can assign NULL to const pointer after initializing once.
What makes C++ to support function overloading ?
Following functionality in C++ violates the encapsulation.
What is the memory of a class that contains niether data members nor member functions ?
How many differnces are there between structures in C and C++ ?
How many differnces we can find between structures in C and C++ ?
We can initialize following type of variables in class declaration.
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());
}
}
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 */
In which all cases does an exception gets generated. Select the two correct answers. int i = 0, j = 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);
}
}
JAIN stands for Java Integrated Networks
JAF stands for Java Activation Framework
JCA stands for Java Communications API
JCE stands for Java Communication Extension
JDO stands for Java Data Objects
JSSE stands for Java Socket Service Extension
JAX-WS stands for Java API for XML Web Services
JAX-RS stands for Java API for RESTful Web Services