Code Samples
Code Samples is a collection of code snippets exemplifying the Java programming language and other languages. Example code comes from various published documents on java.sun.com, and are also provided by the developer community. Use Code Samples for your own programming, and add your own examples to this collection.
Before adding code to this wiki, see the About Code Samples page for more information about this Code Samples wiki, how to add to it, and some general guidelines to follow.
Categories in Code Samples
- Java Platform, Standard Edition (Java SE)
- Java Platform, Enterprise Edition, (Java EE)
- JavaFX Platform
- Java Platform, Micro Edition, (Java ME)
- Java Card - Smart Card Technology
- Database Technologies
- Scripting Languages
- Cross-Platform Technologies
Java Platform, Standard Edition (Java SE)
- Language Syntax
- Numbers and Math Operations
- Life Cycle of An Object
- Reading and Writing Data
- Classes and Inheritance
- Reflection
- Threaded Programs
- Swing and GUI Programming
- Multi-Media
- Error Handling
- Internationalization
Java Platform, Enterprise Edition, (Java EE)
- Specific Java EE Technologies
- Auction Application Code Samples from Advanced Programming for the Java 2 Platform.
- Java BluePrints.
- Java EE Connector Architecture
- Web Services
JavaFX Platform
Java Platform, Micro Edition, (Java ME)
- Code Samples from the Mobility Developer web site.
MIDP/CLDC
- You can download MIDP code samples from the Java series book Programming Wireless Devices with the Java 2 Platform, Micro Edition.
- MIDP code samples from the Wireless Developer web site.
Java Card - Smart Card Technology
- Code Samples from the Java series book Java Card Technology for smart cards.
Database Technologies
The following code samples are used for databases, such as MySQL, and technologies such as JDBC connectivity.
Scripting Languages
Cross-Platform Technologies
- Internationalization: Designing an application so it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting software for a specific region or language by adding locale-specific components and translating text.
- Java BluePrints: Illustrating design patterns and best practices for Java platform-based end-to-end (client-server) solutions.
- Security: Signing and verifying signed data, encrypting and decrypting data, and writing a security manager. A security manager is a Java virtual machine (JVM 1) object that implements a security policy such as prompting an end user for password verification.
- NetBeans Sample Catalog: Browse the NetBeans Sample Catalog for a comprehensive collection of sample applications spanning the latest enterprise, web, mobile, and scripting technologies.