Interview Questions

Q:

public class Threads2 implements Runnable {

public void run() {

System.out.println("run.");

throw new RuntimeException("Problem");

Which among the following is true?

}

public static void main(String[] args) {

Thread t = new Thread(new Threads2());

t.start();

System.out.println("End of method.");

}

}

A) java.lang.RuntimeException: Problem B) run. java.lang.RuntimeException: Problem
C) End of method. java.lang.RuntimeException: Problem D) End of method. run. java.lang.RuntimeException: Problem
 
Answer & Explanation Answer: D) End of method. run. java.lang.RuntimeException: Problem

Explanation:

Only D can be true

Report Error

View Answer Report Error Discuss

Filed Under: Java - Technology

0 20323
Q:

Choose the correct html tag to make a text italic.

1. <italic>

2. <it>

3. <i>

4. <il>

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

Explanation:

HTML Tag  is used to make a text italic.

Report Error

View Answer Report Error Discuss

23 20172
Q:

Which tag is used to display the numbered list?

 

1) <ol> </ol>    2) <li></li>     3) <ul> </ul>    4) <dl> </dl>

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

Explanation:

Use HTML tag <ol> element to define an ordered list.

Use the HTML type attribute to define the numbering type. Use the HTML <li> element to define a list item. Use the HTML <dl> element to define a description list.

 

Hence, as numbered list come under ordered list tag <ol> tag is used for numbered list.

Report Error

View Answer Report Error Discuss

12 19941
Q:

Javascript is interpreted by

A) Server B) Object
C) Client D) None of the above
 
Answer & Explanation Answer: C) Client

Explanation:

JavaScript is an interpreted language, not a compiled language. A program such as C++ or Java needs to be compiled before it is run.

The source code is passed through a program called a compiler, which translates it into bytecode that the machine understands and can execute.

Report Error

View Answer Report Error Discuss

Filed Under: Java - Technology
Job Role: Analyst , IT Trainer

19 19890
Q:

Explain what is BRS?

Answer

BRS - Bank Reconciliation Statement


 


A bank reconciliation statement is a statement prepared by organizations to reconcile the balance of cash at bank in a company's own records with the bank statement on a particular date.


 


The differences may arise because of the following reasons:


 


     - Cheques deposited into bank but not yet collected by bank


 


     - Cheques issued by the organization but not yet presented for payment


 


     - Cheques directly deposited by customers into the bank


 


     - Bank charges debited by bank


 


     - Interest credited or some receipts directly collected by bank based on org. request.


 


     - Some payments directly made by bank based on the organizations request.


 


So, the statement shows the reasons as what are the reasons for difference in balance.

Report Error

View answer Workspace Report Error Discuss

22 19366
Q:

main() {

int i;

printf("%d",scanf("%d",&i)); // value 10 is given as input here

}

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

Explanation:

Scanf returns number of items successfully read and not 1/0. Here 10 is given as input which should have been scanned successfully. So number of items read is 1.

Report Error

View Answer Report Error Discuss

Filed Under: Java - Technology

2 18057
Q:

 What is the string contained in s after following lines of code?

StringBuffer s = new StringBuffer(“Hello”); s.deleteCharAt(0);  ?

A) llo B) Hllo
C) ello D) H
 
Answer & Explanation Answer: C) ello

Explanation:

deleteCharAt() method deletes the character at the specified index location and returns the resulting StringBuffer object.

So after deleting the character at 0 ie 'H', the string returns 'ello' as the output.

Report Error

View Answer Report Error Discuss

Filed Under: Java - Technology
Job Role: Analyst , IT Trainer

3 17815
Q:

How to use HTTP Headers inside PHP? Write the statement through which it can be added?

Answer

HTTP headers can be used in PHP by redirection which is written as:


<?header('Location: https://www.php.net')?>


The headers can be added to HTTP response in PHP using the header(). The response headers are sent before any actual response being sent. The HTTP headers have to be sent before taking the output of any data. The statement above gets included at the top of the script.


 

Report Error

View answer Workspace Report Error Discuss

Subject: PHP - Technology

1 17749