Which Protocol is used to deliver email to recipient mail Server?
Options
- SMTP
- POP
- IMAP
- MAPI
What type of messaging in provided by JMS?
Answer
Following program have compilation error, can you guess root cause of it?
abstract class VQCourse {
public String courseName;
public String courseID;
} public class VirtuQCourseProvide extends VQCourse {
public static void main(String[]args) {
VQCourse course1 = new VQCourse();
course1.courseID = "0001";
course1.courseName = "JAVA";
System.out.println(course1.toString());
}}
Answer
Code below has class VQClassB which inherits another class VQClassA, study following code carefully and choose correct option about program output.
package com.vq.classes;
public class VQClassB {
class VQClassA {
public VQClassA(int x) {
this.x = x;
} protected int x;
} public VQClassB(int x, int x2, int y) {
x = x2;
this.y = y;
}
private VQClassB(int x, int y) {
this.x = x;
this.y = y;
}
private int x;
private int y;
public static void main(String[]args) {
VQClassB vqb = new VQClassB(20, 10);
VQClassB.VQClassA vqa = new VQClassB(10, 10).new VQClassA(10);
System.out.println(vqa.x + " " + vqb.x);
}
}
Answer
ode below has class VQClassB which inherits another class VQClassA, study following code carefully and choose correct option about output of program.
package com.vq.classes;
class VQClassA {
public VQClassA(int x) {
this.x = x;
} protected int x;
}
public class VQClassB extends VQClassA {
public VQClassB(int x, int x2, int y) {
super(x);
x = x2;
this.y = y;
} private VQClassB(int x, int y) {
super(x);
this.x = x;
this.y = y;
}
private int x;
private int y;
public static void main(String[]args) {
VQClassA vqa = new VQClassA(10);
VQClassB vqb = new VQClassB(20, 10);
vqa = vqb;
System.out.println(vqa.x + " " + vqb.y);
}
}
Answer
Class VQCourse contains declaration about a course, which is inside package com.vq . You are declaring a new class VirtuQCourseProvider where you want to create a object of VQCourse but following program fails to compile. Choose option which eliminates compilation error.
public class VirtuQCourseProvide {
public static void main(String[]args) {
VQCourse course1 = new VQCourse();
}}
Answer
Which of following statement(s) can result in new object instance creation if executed successfully.
AnswerChoose correct equivalent statement of following code.
int[][] arr = new int[3][];
for (int i = 0; i < arr.length; i++)
arr[i] = new int[3];
Answer
Which statement(s) is true about following program?
public class VirtuQCourseProvide {
public static void main(String[]args) {
String firstName = "VirtuQ";
String lastName = "Simplifying Education";
String FullName = firstName + lastName;
String courseProvider = FullName;
}}
Answer
What will be the output of the program?
String s = "hello";
Object o = s;
if( o.equals(s) )
{
System.out.println("A");
}
else
{
System.out.println("B");
}
if( s.equals(o) )
{
System.out.println("C");
}
else
{
System.out.println("D");
}
What will be the output of the program?
public class ExamQuestion6
{
static int x;
boolean catch()
{
x++;
return true;
}
public static void main(String[] args)
{
x=0;
if ((catch() | catch()) || catch())
x++;
System.out.println(x);
}
}
Answer
What will be the output of the program?
try
{
Float f1 = new Float("3.0");
int x = f1.intValue();
byte b = f1.byteValue();
double d = f1.doubleValue();
System.out.println(x + b + d);
}
catch (NumberFormatException e) /* Line 9 */
{
System.out.println("bad number"); /* Line 11 */
}
Answer
Which of the following statements is true?
Which two statements are true?
Which method must be defined by a class implementing the java.lang.Runnable interface?
AnswerWhich of the following are true statements?
What is the numerical range of char?
AnswerWhich collection class allows you to access its elements by associating a key with an element's value, and provides synchronization?
AnswerYou need to store elements in a collection that guarantees that no duplicates are stored. Which one of the following interfaces provide that capability?
AnswerAt Point X on line 5, which code is necessary to make the code compile?
public class ExceptionTest
{
class TestException extends Exception {}
public void runTest() throws TestException {}
public void test() /* Point X */
{
runTest();
}
}
Answer
© 2017 QuizBucket.org