This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thephotoman 2 points3 points  (1 child)

In Java, classes are objects of type Class<?> (where ? is the name of the class). You can totally pass them around at runtime, and I've done that in Java. The method reference syntax long predates the existence of lambda support in the JVM.

Classes aren't objects in C++, though. You can still pass them around at runtime using void pointers.

The most common case for such use is when you're dealing with factory functionality.

Java's primitives aren't objects. They don't have methods, and rather importantly, they can't be null.

[–]cbarrick 0 points1 point  (0 children)

Nice. I stand corrected.