Sunday, 24 June 2018

TCS Tech Lounge JAVA Final-11

In BufferedOutStream, the method finalize is inherited from:
ANS: java.lang.Object

Subclass of Outputstreamwriter is _ _ _ -
ANS: FileWriter

LIKE operator is used for pattern matching?
Ans: true

Which of the following is FALSE Regarding String methods?
ANS:  Object equals(object another) (bcz equals returns Boolean)

If a statement tries to divide by zero which exception is thrown?
ANS: ArithmeticException

Java.io.FileOutputStream extends from which class?
ANS: java.io.OutputStream


Which of the following is not true in case of an interface?
i.                    Interface cannot be instantiated
ii.                  All methods in interface are abstract
iii.                An interface can inherit multiple interfaces are abstract
iv.                 An interface contains instance fields
ANS:  I, ii, iii are correct

public class Test1{
                                public static void main(String[]args){
                                    int i=1;
                                    do{
                                                i++;
                                    }while(i<10);
                                                System.out.println(i);
                                }
}
ANS: 10

Using mail API we cannot send mail from a servlet?
ANS:  false

Which statement will return true if atleast one condition is true?
ANS: (condition1 | | condition2)

Public static void main(String args[])
{
Int acsii[] = {65,66,67,68};
String s  = new String(ascii,1,3);
System.out.println(s);
}
}
ANS: BCD

What will be the output of the below program?
Public class Test{
Public static void main(String[] args){
String value = “abc”;
changeValue(value);
System.out.println(value);
}
Public static void changeValue(String a){
A=”xyz”;
}
}
ANS: abc

Byte Stream Classes support input/output operations on _ _ _ _ bytes:
ANS: 8 bit byte

Public static void main(String args[]){
Int I,j,k,l=0;
K=l++;
J=++k;
I=j++;
System.out.println(i);
}
}
ANS: 1

The close method of BufferedInputStream accepts parameters.
ANS: false

The relational model is based on the concept that data is organized and stored in two-dimensional tables called _ _ _
ANS: Relations

Objects are stored on stack
ANS: false

No comments:

Post a Comment