May 2018
Beginner to intermediate
290 pages
6h 43m
English
While Java classes mostly exist to define the behavior of their instances, the classes themselves are also objects with a class—java.lang.Class—and fields and methods of their own. The fields and methods provided by classes (static methods and fields in Java parlance) are independent of any particular instance of the class.
For example, the File class carries around a field called separator that contains the character that goes between the bits of your path for the operating system you’re working on. In a Clojure program you can get at static fields by writing class/field. Thus if you evaluated this:
| | File/separator |
on a Linux box or a Mac, you would get a string containing a forward slash. Evaluate the same expressions ...
Read now
Unlock full access