Java, J2EE, J2SE, Object Oriented Programming
This example demonstrates a multi-threaded program that must share a resource between threads. Each thread will be required to obtain an exclusive lock on the shared resource to avoid a potentially disastrous conflict. We will create two threads, one called MissileFactory and one called MissileLauncher. The… view article
The following class demonstrates the use of Java's Format, Number, Date and Locale classes (util.*, text.*). It also shows how to serialize and de-serialize and object by implementing the Serializable interface (io.*). Item.java //Demonstrates: //Serialization, //Number/Currency Formatting,… view article
The following class demonstrates basic use of Java's Pattern and Matcher class by adding the rel attribute 'nofollow' to the anchor tags of several links. *Note, this is for educational purposes only. Pattern, Matcher and Regex are NOT ideal for manipulating HTML in Java. NoFollow.java //Adds… view article
This example shows how to connect to, and query, a MySQL database in Java using JDBC. The example will attempt to implement the singleton design pattern. The singleton design pattern restricts the instantiation of a class to one object. First get a copy of the MySQL JDBC driver at: http://www.mysql.com/downloads/connector/j/ Extract… view article
This tutorial shows how to retrieve an XML document from a URL and parse it using Java's SaxParser. The XML in question comes from a zekkocho exclusive API that returns a random set of Japanese words along with their possible Engilsh definitions. http://www.zekkocho.com/api/japanese/wordset.php?n=5 − 効力 こうりょく effect efficacy validity potency ... Before… view article