If a variable of a reference (composite) type isn't storing a reference to an object, then it stores what is known as a 'null reference'. IF String s; & String s=null; are same than why i am not getting null as output. Tried 2 Ex as follows but didn`t get null as output. 1.
class Person{
    public static void main(String[]args){

     String s;

    System.out.println(s);
    }

}
2.
class Person{
    public static void main(String[]args){
        Person pr = new Person();

        System.out.println(pr);
    }

}