User-submitted Java Projects

36
2599 reads
SillySall's picture

Submitted by

SillySall
Nested Inner Classes
The below program demonstrates how to create nested inner class in java. In the below example , Class Inner is defined within Class Outer and can access Class Outer's datafield.
Run It Now!
39
2221 reads
Named Local Inner Classes
The below program demonstrates how to create named local inner class.
Run It Now!
37
2972 reads
Anonymous Local Inner Classes
The below program demonstrates how to create anonymous local inner class.
Run It Now!
24
2103 reads
Non-Static Member Inner Classes
The below program demonstrates how to create non-static inner class in java. In the below program, class LifeBenefit is a innerclass to class LifePolicy .
Run It Now!
32
2378 reads
Static Member Inner Classes
The below program demonstrates how to create a static inner class and access it. The below program has class LifePolicy which defines a Static Inner class LifeBenefit which extends class Benefit.
Run It Now!
35
2279 reads
SillySall's picture

Submitted by

SillySall
Object Cloning
The below program demonstrates how to clone an object. In the below program x1,x2 are two objects of class TestClone1 which implements cloneable.The x1 object is clone and assigned to x2 object.
Run It Now!
64
2709 reads
Cloning Objects with Object Data Fields Example
The below example demonstrates how to clone an object with object data field example.
Run It Now!
75
2523 reads
Stephens's picture

Submitted by

Stephens
Clonning an Object Example
The below example demonstrates how to clone an object in java. The below example creates two objects(p,q) of Class Point. The object p is cloned and assigned to object q.
Run It Now!
80
2430 reads
Stephens's picture

Submitted by

Stephens
Reference Assignment
The below example demonstrates how to assign a reference to an object. The below example creates two different objects for class Point.
Run It Now!
39
2333 reads
Overriding Methods from Object
The below example demonstrate the use of equals() in java.
Run It Now!