Could someone explain me the .getClass() method in java
I am currently taking a java class in university. This is my first programming class and I've stumbled on something that I just cannot understand. As i learned, there are two ways of comparing variables. The first is using the == , != , < , > , =< , >= signs for PRIMITIVE variables such as int,double,etc. and the second way is to use the .equals() method for reference type. Now here is my question: When I use the .getClass() method, I can compare two classes with the .equals() method and the == / != method. Since I can use the == / != signs, I'd suppose that the .getClass() method which