User-submitted Java Projects

35
2255 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!
32
2374 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!
24
2099 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!
37
2967 reads
Anonymous Local Inner Classes
The below program demonstrates how to create anonymous local inner class.
Run It Now!
39
2219 reads
Named Local Inner Classes
The below program demonstrates how to create named local inner class.
Run It Now!
36
2587 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!
33
2625 reads
Roberto's picture

Submitted by

Roberto
Final Modifier in java.
The below program demonstrates how to use Final Modifier in java. The below program defines a final variables in Class Final1 named ( i, a, j) and assigns the value to them.
Run It Now!
65
1332 reads
Rohan's picture

Submitted by

Rohan
Prototype
This example demonstrates prototype in java.prototype Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Run It Now!
271
3158 reads
Rohan's picture

Submitted by

Rohan
Chain of Responsibility
this example demonstrates Chain of Responsibility in java.It avoids attaching the sender of a request to its receiver, giving this way other objects the possibility of handling the request too. - The
Run It Now!
71
2088 reads
Rohan's picture

Submitted by

Rohan
Roman Numeral Converter
This example demonstrates Roman Numeral Converter in java.The classical example fot the interpreter pattern is the one of interpreting the roman numerals.
Run It Now!