4) Find the output for the below snippet
public class CanGo {
int a = 08;
static int b = 07;
static int c =1234;
public static void main(String[] args) {
System.out.println(” “+b+c);
}
}Output: Compilation error saying – The literal 08 of type int is out of range.Reason: Please remember – In Java – Any number prefixed with a 0 is considered as octal value. Octal numbers can only use digits 0-7, similar to decimal can use only 0-9, and binary can use only 0-1.

5) What happens for a null object?
public static void main(String[] args) {
CanGo cg=null;
cg.show();
}
static void show() {
// TODO Auto-generated method stub
System.out.println(“name”);
}Output: nameReason: Here object (cg) is set to null. Now the Garbace Collector (GC) will check whether that object is assigned to other reference or not. If the object is not assigned to any reference then, that object will be removed from heap by Garbage Collector. But, in this case, the object is set to null first and immediately in the next line, it is being referred for calling show() method.