I am having a basic java question as I recently decided to dig into the language (I have been working exclusively with C++ for a long time and decided to expand my horizons a bit).
Assuming that I have a class called BankAccount and I try to create and object in my main, what is the difference between:
Class baCls = BankAccount.class;
Class<BankAccount> baCls = BankAccount.class;
In both cases
baCls is a reference to the class
The generic adds a compile time check but has no impact at runtime.
You can see the bytecode generated if you use
javap -c -p or a byte code viewer in your IDE.