public class Solution { public static void main(String[] args) { //write your code here Cat cat1 = new Cat(); Cat cat2 = new Cat(); System.out.println(cat1); // This gives output as the memory address of the object } public static class Cat { System.out.println(cat1); // But when i commented the SOP statement in main method and try to print this one, on compilation it gives error <identifier expected> why? } }