System.out.println("Constructor of GG");
}
public static void main(String[] args) {
GG obj = new GG();
System.out.println(obj);
}
}
OUTPUT:
Constructor of GG
GG@1f32e575
What is that 'GG@1f32e575' in the output and why is it coming?
You're printing the memory location of the just created object
Its like object identifier maybe you need to modify the method toString() form the class Object if you want the expecifict informacion of the class but the class is empty, sorry my english is very bad
Also the funcionality of the constructor is initialize of the attributes. Maybe you can do that but that is not correct
Обсуждают сегодня