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 ?
9. what will be out of the below code ?
10. what will be out of the below code ?
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--);
}
public class callkr {
public static void main(String[] args) {
float f=10.5f;
float f1=++f;
System.out.println(f1);
}
}
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;
a= a-- - --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;
a= a-- + ++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);
}
}
Q14) callkr
ReplyDeleteQ15) I think operator missing in line int y,if so then compile tym error.