Hey everyone,
I’ve been programming in Java for a good many years now, but this sort of problem has never come up before.
You can tell what type of class a reference is by doing
if (obj instanceof java.lang.String)
System.out.println(“It’s a string!”);
But how can you discern between primitives? Is there a reserved word for it, or is there some other special trick?
Thanks!