User-submitted Java Projects

397
3655 reads

February 24, 2013

Generic Constructor


Generic constructors can use generics to mutate some parameters whose references aren't retained, as syntax is
NonGeneric(T obj, List list) {
list.add(obj);

58
2396 reads

February 24, 2013

Generic Method


Generic methods are methods that introduce their own type parameters. This is similar to declaring a generic type, but the type parameter's scope is limited to the method where it is declared.

366
4914 reads

February 24, 2013

Bounded Wildcard


The wildcard can be used in a variety of situations: as the type of a parameter, field, or local variable; sometimes as a return type.

56
2466 reads

February 24, 2013

Wildcard Demo


Wildcard is a special actual parameter for the instantiation of generic (parameterized) types. It can be used for the instantiation, not in the definition of a generic unit.

197
2844 reads

February 24, 2013

Generic class of Array


This example demonstrates you to create a generic class that can compute the average of an array of numbers of any given type (as in example only integer and float).

212
4148 reads

February 24, 2013

Generic with Two Parameters


This example shows the implementation of generic class with two parameter-type.
But here we have created the object of only one type.

121
2595 reads

February 23, 2013

Non-Generic


This example demonstrates you the functionality of a Generic class and a non-Generic class that are equivalent to each other.
Here class NonGen is similar to Gen but does not use generics.

355
3416 reads

February 23, 2013

Generic class


This example demonstrates that how to create a generic class with a type-parameter.
Generic classes can hold the object of any class and where a type variable is unqualified identifier.

34
1468 reads
Bodymass
This is a funny fat calculator...It will calculate and seperate the (bone and organ weight) from fat mass...The required weight you should have...and also It may tell you suggestions on reducing your
Bodymass

Run It Now!
34
2271 reads

February 22, 2013

Varargs, Overloading and Ambiguity


This program contains an error and will not compile!