Hello Everyone ! we will be learning most frequent interview asked question with its explanation. And we will be talking about the way we think before solving or giving answer to interviewer .So keep enjoying . Happy java learning..!!
IF YOU NEED EXPLANATION TO ANY QUESTION JUST COMMENTS FOR REQUEST WITH QUESTION NO.
1. What will be the output in below code?
public class q1 {
public static void main(String[] args) {
byte b2=15;
System.out.println(b2);
}}a:error b:15 c:none
2.What will be the output in below code?
public class q1 {
public static void main(String[] args) {
int x;
x=15;
byte b2;
b2=x;
System.out.println(b2);
}}
A . error B.15 C.none
3. What will be the output in below code?
public class q1 {
public static void main(String[] args) {
byte b2=130;
System.out.println(b2);
}}
A . error B.130 C. not in range D.a&b
4. In how many way character code can be written ?
5. What is the suffix of all the data type ?
7. What will be the output of below code?
System.out.println(5.5f,
+4.5F);
8. Can we convert long to
float data type?
9. What will be the output of
following question?
System.out.println(0.5*1==0.5);
10. what is boolean data type and its default value ?
Q4) 2 ways to write char
ReplyDeletechar ch1='a';
char ch2='\u0061';