Languages [3i Infotech Placement]: Sample Questions 20 - 22 of 546

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 20

Languages
Edit

Write in Short

Short Answer▾

Can an abstract class may be final?

Explanation

  • No, abstract class may not be declared as final.
  • A final class is considered complete and cannot be sub classed.
  • Abstract classes require the implementation to provide definition to abstract methods in the subclasses.
  • Thus, a final class cannot have abstract methods and an abstract class cannot be declared final.

Question 21

Languages
Edit

Write in Short

Short Answer▾

In an “. htm” form I have a button that makes us to open another page in 15 seconds. How will you do that?

Explanation

  • On the on-click of the button create a thread and make it sleep for 5 second.
  • Then the action (jsp) file will be called.

Question 22

Edit

Write in Short

Short Answer▾

What is the output of the following program?

  1. main ()
  2. {
  3.     inti =-1;
  4.     +i;
  5.     printf ( “i =%d, +i =%d” i, +i);
  6. }

Explanation

i =-1, + i =-1

In a program

Table Shows the Program
int i =-1;Define the integer variable i =-1.
+ i;
  • Apply unary operator
  • Unary + is the only dummy operator in C.
  • Ignore it as it has no effect in the expressions (hence the name dummy operator) .
printf ( “i =% d, + i =% d” i, + i) ;Print the i =-1 and + i =-1
Define the Unary Operator and How to Use in Expression

Developed by: