Package edu.pdx.cs.joy.lang
package edu.pdx.cs.joy.lang
This package contains example Java programs that demonstrate fundamental aspects of the Java programming language such as declaring variables, handling exceptions, and class inheritance.
Some Java Language Resources:
- The Getting Started trail of Sun's Java Tutorial
- The exceptions trail of Sun's Java Tutorial
- The Java Language Specification (not the best way to learn the language)
Links about annotations and annotation processing
-
ClassDescriptionThis program demonstrates exception handling by reading two integers from the command line and prints their sum.This class is the base class in our animal hierarchy.Deprecated.This class shouldn't be used anymoreThis class represents an ant.Demonstrates J2SE primitive data "autoboxing" features.This class represents a bee.This class represents all birds.This class demonstrates covariant returns in JDK 1.5.An animal that can be cloned.This class represents a cow.This class demonstrates throwing exceptions.This class demonstrate the
instanceofoperator and the concept of interfaces using the animal hierarchy.This class represents a duck.Demonstrates J2SE's "enhanced for loop" functionality.Demonstrates J2SE's "enumerated type" facility.This interface is implemented by all animals that can fly.This class demonstrates how generic collections can be used with legacy code that does not use generics.A "legacy" class that does not use generic collections.A grad studentA studentThis class demonstrates how updated domain classes that use generics can interact with legacy code that doesn't use generics.An updated domain class that uses genericsA grad studentA studentThis class simply prints "Hello World".This class represents a human being (not a human doing).This class represents an insect.This class demonstrates Javadoc commentsThis class represents all mammals.Demonstrates adding behavior to enumerated types.This class demonstrates theOverrideannotation.This class contains one method that is overridden in a subclass.Demonstrates Java's pass by value mechanismThis class demonstrates constructors, the toString method, and instance fields.This class has a main method that demonstrates the effects of inheritance and virtual method dispatches using the animal class hierarchy.This class represents a Sheep.Demonstrates J2SE's "static import" facility.Tuple<A,B> A tuple class that holds two generic values.Uses the genericTupleclass to return a host/port combination from a single method.This class represents a Turkey.This program uses Java's reflection mechanism to print the name of a givenObject's class.