Home : Course Map : Chapter 4 : Java :
Exercises
JavaTech
Course Map
Chapter 4

Introduction
Inheritance
  Demo 1
Overriding
  Demo 2a
  Demo 2b
this,super
MoreConstructors
  Demo 3
Abstraction
Interface 
  Demo 4
Casting References
MoreAboutArrays
Object class
Class Summary
Exercises

    Supplements
Override/Overload
Annotation-J2SE5.0
Java Security
Class Loading
Class Verifier
SecurityManager
     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

 

  1. Create an applet with two parameters passed in the applet tag. The first parameter indicates the numeric type (integer or floating point) of the second parameter value.

    Using the first parameter as a flag to choose which one of two overloaded methods in a Test class object to pass the second parameter as an argument. Print out a message indicating which method was selected.

  2. Create a class heirarchy for some family of interest, such as bird, particle, or automobile. Build subclasses that represent specific types on an abstract base class.

    For example,a Fruit class would provide the base for several subclass fruit types such as apples, oranges, pears, etc. Include methods in Fruit that provide properties of the fruit such as the color (e.g. String getColor()) , shape, average weight, etc. The subclasses will override these methods to provide the properties unique to a particular fruit. For one of the classes, e.g. pear, create subclasses for particular types, such as Bartlet and Anjou pears.

    In the main() routine, create instances of the different classes and invoke methods that print out the property values such as color, shape, etc..

            Tech
MoreComplexClass
ImprovedHistogram
JavaRandomNums
Vectors & Matrices
Exercises

           Physics
Runge-Kutta 2nd
  Demo 1
Runge-Kutta 4th
  Demo 2
BoundaryVal.Prob
Shooting Method
  Demo 3
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.