Saturday, 21 January 2017

level 1 : 10 Step by step interview question to crack the interview.

1. Why variables are called as container ? And what it can hold?
2. Do variable has its type ?
3. Can we call a variable an identifier ?
4. Where we can define variable in our class ?
5. Which is invalid variable definition ?
    a. call kr
    b. 123callkr
    c. callkr@javatilldate
6. can we use (_) is variable name ?
7. what is operator in java? what this expression mean x++ , ++x in java ?
8. what will be out of the below code ?

public class callkr {
public static void main(String[] args) {
       int a=25;
       System.out.println(a++);
       System.out.println(a--);
 }
9. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       float f=10.5f;
       float f1=++f;
       System.out.println(f1);
       }

}

10. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       int a=20;
    a= a++ + 1;
    System.out.println(a);
       }

}

11.what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       int a=20;
       a= a++ + a++;
    System.out.println(a);
 }
}

12. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       int a=20;
       aa-- - --a;
    System.out.println(a);
 }
}

13. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       int a=20;
       aa-- + ++a;
    System.out.println(a);
 }
}

14. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
    int x=21;
    String callkr = (x < 15) ? "important" : (x < 22)? "callkr" : "javatilldate";
    System.out.println(callkr);
}
}

15. what will be out of the below code ?
public class callkr {
public static void main(String[] args) {
       int x=100;
       int y=x-- --x;
       x=x+2;
    System.out.println(x);
}
}

1 comment:

  1. Q14) callkr
    Q15) I think operator missing in line int y,if so then compile tym error.

    ReplyDelete