Sunday 24 June 2018

TCS Tech Lounge JAVA Final-14

public class precedence{
                                public static void main(String[] args){
                                    int i = 0;
                                    i= i++;
                                    i= i++;
                                    i= i++;
                                    i= i++;
                                    System.out.println("The value of is"+i);
                                    int arr[] = new int[5];
                                    int index = 0;
                                    arr[index] = index = 3;
                                    System.out.println("The value of first element is"+arr[0]);
                                    System.out.println("The value of fourth element is"+ arr[3]);
                                }
}
ANS: all of the above
The value of i is 0
The value of first element is 3
The value of fourth element is 0

Which of the following has child class?
ANS: FilterReader

Which of these operator is used to allocate memory to array variable in java
ANS: new

What are the key elements of Problem Solving?
ANS:  ALL of these ( declarative & Imperative Knowledge, Good analytical Skills)

public class Exam1{
                                public static void main(String[] args){
                                    int a=5;
                                    int b=2;
                                    int c=a-b;
                                    if(c=3){
                                                System.out.println("Thats correct");
                                    }else{
                                                System.out.println("thats worng");
                                    }
                                }
}
ANS: Compile error

JRE stands for java _ _ _Environment
ANS: Runtime

Which statement is true?
1.      Serialization applies only to OBJECTS
2.      Static variables are NEVER saved as part of the objet state.So static variables are not Serializable.
ANS: Both statements 1&2

Issuing commit command does which of the following
ANS: Release all savepoints

Which of the following is the weakest relationship
ANS: Dependecy

Which of these contain heterogenous objects
ANS: ArrayList

How many parameter does readBoolean() of DataInputStream accepts?
Ans: 0

Which is not method of InputStreamReader
ANS: open()

For a static field, regardless of the number instances created, will hold the same data across all objects
ANS: TRUE

Single line comment starts with _ _ _ in java
ANS: //

What is the name of the stream that connects two running programs?
ANS: Pipe

Hotspot is an implementation of the JVM concept.It provides
ANS: garbage collector


Which method returns the time when the session was created?
ANS: getCreateTime()

public class precedence{
                                public static void main(String[] args){
                                int num = 10;
                                switch(num){
                                    case 8: System.out.println("The selection is 9");
                                    break;
                                    case 20: System.out.println("The selection is 20");
                                    break;
                                    case 30: System.out.println("The selection is 30");
                                    break;
                                    case 40: System.out.println("The selection is 40");
                                    break;
                                    default: System.out.println("Invalid Selection");
                                }
                                }
}


ANS: Invalid selection

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
    Creative Thinking for creating an impact!
    Product Thinking Community introduces PT Labs powered by Leanpitch
    Product thinking conference

    ReplyDelete