How does Class Class actually represent other Classes and interfaces in java?

40 Views Asked by At

I've been trying to understand that how the Class Class actually works in java but everywhere I look all it says is that its references represent the Classes and Interfaces in a running java application but nowhere I've managed to find that how actually it does that? Does it store the name of the Classes as a String property? or is it something else? Also I've seen in Spring applications we pass SpringApplication.run(SomeClass.class, args) and all people say that we are passing it because because we need to pass the name of class, If it so then why can't we just pass it as a String like this SpringApplication.run("Name of that class", args)? And what is the advantage of getting the object of Class Class for a certain Class or Interface?

0

There are 0 best solutions below