Interview Questions

Q:

Which of the following are capabilities of functions in JavaScript?

A) Accept parameters B) Return a value
C) Accept parameters and Return a value D) None of the above
 
Answer & Explanation Answer: A) Accept parameters

Explanation:

Accept parameters are capabilities of functions in JavaScript.

Report Error

View Answer Report Error Discuss

Filed Under: Java
Exam Prep: AIEEE , Bank Exams
Job Role: Analyst , Bank Clerk , Database Administration , IT Trainer

13 14130
Q:

X implements Y, Z

Arguments:

1. X should be class
2. Y, Z should be interfaces

A) Only 1 is true B) Only 2 is true
C) Both 1 and 2 are true D) None
 
Answer & Explanation Answer: C) Both 1 and 2 are true

Explanation:

Both the statements are true 

Report Error

View Answer Report Error Discuss

Filed Under: Java
Job Role: IT Trainer

0 13929
Q:

public abstract class Shape {

private int x;

private int y;

public abstract void draw();

public void setAnchor(int x, int y) {

this.x = x;

this.y = y;

}

}

Which two classes use the Shape class correctly?

A) public class Circle implements Shape { private int radius; B) public abstract class Circle extends Shape { private int radius; }
C) public class Circle extends Shape { private int radius; public void draw(); D) None
 
Answer & Explanation Answer: B) public abstract class Circle extends Shape { private int radius; }

Explanation:

Only B is true

Report Error

View Answer Report Error Discuss

Filed Under: Java

0 13823
Q:

How many of the following will follow JavaBean Listener naming rules?

addListener

addMouseListener

deleteMouseListener

removeMouseListener

registerMouseListener

 

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: B) 2

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Java

0 13819
Q:

How do you put a message in the browser's status bar ?

A) status("put your message here") B) window.status = "put your message here"
C) statusbar = "put your message here" D) window.status("put your message here")
 
Answer & Explanation Answer: B) window.status = "put your message here"

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Web Technology

5 13659
Q:

What will be the output of the following code snippet?

Object s1 = new String("Hello");
Object s2 = new String("Hello");
 
if(s1 == s2) {
  System.out.println("s1 and s2 are ==");
}else if (s1.equals(s2)) {
  System.out.println("s1 and s2 are equals()");
}

Answer

Answer : s1 and s2 are equals()


 


Explanation :



 

Report Error

View answer Workspace Report Error Discuss

Subject: Java

7 13386
Q:

Which of the following attribute can hold the JavaScript version?

A) script B) version
C) language D) none of the above
 
Answer & Explanation Answer: C) language

Explanation:

Language attribute contains the javascript versions.

Report Error

View Answer Report Error Discuss

Filed Under: Java
Job Role: Analyst , IT Trainer , Software Architect

8 13275
Q:

Which of the following is not a keyword?

A) assert B) pass
C) eval D) nonlocal
 
Answer & Explanation Answer: C) eval

Explanation:

"eval" is not a keyword and is can be used as variable.

Report Error

View Answer Report Error Discuss

Filed Under: Java

19 13120