According to a lecture on Coursera, classes are types and if we have a class called Book, for example, we can write a line of code-
Book book = new Book("Java",100);
which would create some data in the heap that we call an object and the variable 'book' of the type "Book" points to that object. Now my question is, that what kind of values can the variable 'book' have? I tried printing it using
System.out.println(book);
and it printed this -
eclipsetest.Book@24d46ca6
('eclipsetest' is the name of my package and 'Book' is the class) So what exactly is happening here?
EDIT: Not a duplicate of this because I know how to print the data using an object without getting that gibberish but I cannot understand what type of data classes as data types can hold. I also tried looking it up further and found that classes are 'reference' data types and hold the 'reference' to an object. How they do it, however, I don't understand since Java does not have any way to print the memory address like C.