admin

admin

Enumerations, Autoboxing and Static Import

Enumerations The identifiers HEART, SPADE, CLUB and DIAMOND are called enumeration constants. Each is implicitly declared as a public, static, final member of Suit. Furthermore, their type is the type of the enumeration in which they are declared, which is…

Multithreaded Programming

Multithreaded Fundamentals Process vs Thread Thread States The Thread Class and Runnable Interface Java’s multithreading system is built upon the Thread class, its methods, and its companion interface, Runnable. Thread encapsulates a thread of execution. Since you can’t directly refer to the ethereal state…

Using I/O

Java’s I/O is Built upon Streams Byte Streams and Character Streams The Byte Stream Classes The Character Stream Classes The Predefined Streams Using the Byte Streams Let’s explore FileInputStream and FileOutputStream by examining an example program named ByteStreamExample, which uses byte streams to copy test.txt, one…