type

type/2 (i,io)

This predicate returns in the second argument the name of the Java class of the object supplied as input in the first argument. The output may already be set to a String value, which will then return success if the class name of the supplied object matches that string.

The following fragment will print the name of the ArrayList class..

	List=java.util.ArrayList(),
	type(List,TypeList),
	println([TypeList]),

This prints

java.util.ArrayList
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.