Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrcfps/core-java-code-samples

Code samples from the Core Java book.
https://github.com/mrcfps/core-java-code-samples

Last synced: about 17 hours ago
JSON representation

Code samples from the Core Java book.

Awesome Lists containing this project

README

        

# Core Java Code Samples

## [Chapter 2](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch02): Java Programming Environment

- [ImageViewer](https://github.com/mRcfps/core-java-code-samples/blob/master/src/ch02/ImageViewer.java): A program for viewing images.

## [Chapter 3](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch03): Java Program Basic Structure

- [InputTest](https://github.com/mRcfps/core-java-code-samples/blob/master/src/ch03/InputTest.java): This program demonstrates console input.
- [Message](https://github.com/mRcfps/core-java-code-samples/blob/master/src/ch03/Message.java): This program demonstrates how to capture command line parameters.

## [Chapter 4](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch04): Objects and Classes

- [ParamTest](https://github.com/mRcfps/core-java-code-samples/blob/master/src/ch04/ParamTest.java): Illustrate behaviors when passing parameters to methods.

## [Chapter 5](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05): Inheritance

### Classes

- [MaxTest](https://github.com/mRcfps/core-java-code-samples/blob/master/src/ch05/MaxTest.java): Demonstrates the use of variable parameters.

### Packages

- [abstractClasses](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/abstractClasses): Demonstrates the use of abstract classes.
- [arrays](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/arrays): Demonstrates the use of reflection for manipulating arrays.
- [enums](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/enums): Demonstrates enumerated types.
- [equals](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/equals): Demonstrates objects comparation.
- [inheritance](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/inheritance): Demonstrates inheritance usage.
- [reflection](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch05/reflection): This program uses reflection to print all features of a class.

## [Chapter 6](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06): Interfaces and Inner Classes

- [anonymousInnerClass](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/anonymousInnerClass): Demonstrates anonymous inner classes.
- [clone](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/clone): Demonstrates object cloning.
- [innerClass](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/innerClass): Demonstrates the use of inner classes.
- [interfaces](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/interfaces): Demonstrates the use of the `Comparable` interface.
- [staticInnerClass](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/staticInnerClass): Demonstrates the use of static inner classes.
- [timer](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch06/timer): Demonstrates events and callback.

## [Chapter 10](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch10): Deploying Applications and Applets

- resources: Demonstrates usage of resources when packing jar files.
- properties: A program to test properties. The program remembers the frame position, size and title.
- preferences: A program to test preference settings. The program remembers the frame position, size, and title.

## [Chapter 11](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch11): Exceptions, Assertions, Logging and Debugging

- stackTrace: A program that displays a trace feature of a recursive method call.

## [Chapter 12](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch12): Generic Programming

### Classes

- Pair: To be used by following packages.

### Packages

- pair1: The simplest use case of generics.
- pair2: Demonstrates how to pose restrictions on type parameters.
- pair3: Demonstrates wildcard types.

## [Chapter 13](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch13): Collections

- linkedList: This program demonstrates operations on linked lists.
- map: This program demonstrates the use of a map with key type `String` and value type `Employee`.
- priorityQueue: This program demonstrates the use of a priority queue.
- set: This program uses a set to print all unique words in `System.in`.
- treeSet: This program sorts a set of item by comparing their descriptions.
- shuffle: This program demonstrates the random shuffle and sort algorithms.
- sieve: This program runs the Sieve of Erathostenes benchmark. It computes all primes up to 2,000,000.

## [Chapter 14](https://github.com/mRcfps/core-java-code-samples/tree/master/src/ch14): Multithreading

- bounce: Shows an animated bouncing ball.
- bounceThread: Shows an animated bouncing ball, running by a thread.
- unsynch: This program shows data corruption when multiple threads access a data structure.
- synch: A bank with a number of bank accounts that uses locks for serializing access.
- synch2: A bank with a number of bank accounts that uses synchronization primitives.
- blockingQueue: Demonstrates the use of blocking queue.
- future: Demonstrates the use of `Callable` and `Future`.
- threadPool: Demonstrates using thread pool in Java.