Sunday 24 June 2018

TCS Tech Lounge JAVA Final-18

An Input device which can read characters directly from an ordinary piece of paper is
Ans: OCR

parseInt() and parseLong() method throws__ ___  _ _ _ ?
Ans: NumberFormatException

To explicitly throw an exception, _ _ _ _ keyword is used.
Ans: throw

How many parameters does the skipByte() accept in DataInputStream class?
Ans: 1

Is the skipByte() of DataInputStream final
Ans: false

Public class Exam1{
Private int a;
Public static void main(Strings[]arg){
/* complete the code using the options so that O is printed in console*/
}           }
ANS: System.out.println(new Exam1().a);
class AccountHolder{
            public AccountHolder(int count){
                       
            }
}
class Account{
            Account(){
                       
            }
}
class Demo{
            public static void main(String[]args){
                        AccountHolder accountholder;
                        accountholder = new AccountHolder();
                        Account accountOne = new Account();
                        Account accountTwo = new Account();
                        Account accountThree = accountTwo;
                        accountThree = accountOne;            
            }
}           while executing the above code, how many reference variable and objects will be crrated
Ans: 3 Objects and 4 references

InputStream class has one constructor.
Ans: True

Java has the characteristic
Ans: All of the above( Portable, Robust, Architecture neutral)

A deployment descriptor describes
Ans: web component settings

What data type does readLine() return?
Ans: String

Which among the following is wrong?
Ans: abstract class can have only static final(constant) variable i.e, by default

What is the result of x when the following loop exists?
Int x=0;
For(in i=0;i<10;i++){
if(i==5){
Continue; }
X++;
}
Ans: 9

String s =”kolkatta”.replace(‘k’,’a’) ?
What would the string “s” would contain after successful execution of the above statement?
Ans: aolaata

The below query returns the students whose age is between 20 to 24 including 20 and 24 also. Select * from Student where Age BETWEEN 20 AND 24
Ans: TRUE

Which life cycle method is called only once in the serbvlet life cycle
Ans: init()

2 comments:

  1. Thanks for sharing this informative content , Great work
    Leanpitch provides online training in Agile coach during this lockdown period everyone can use it wisely.
    Certified agile coaching Bangalore

    ReplyDelete
  2. Thanks for sharing this informative content , Great work
    Leanpitch provides online training in Product prototyping during this lockdown period everyone can use it wisely.
    icp-cat training

    ReplyDelete