0% found this document useful (0 votes)
35 views

Public Class Extends Public Double Super Public Void: Setbalance (Getbalance .50)

The study guide covers three topics: two-dimensional arrays, inheritance, and interfaces. For two-dimensional arrays, students should be able to write a method that manipulates a two-dimensional array. For inheritance, students will write code for an inheritance hierarchy with a Savings subclass that extends an abstract Account superclass. The Account class contains name and balance fields and referenced methods, while the Savings subclass implements a deductFees method. For interfaces, students should apply a user-written interface to a concrete class.

Uploaded by

theomega76
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Public Class Extends Public Double Super Public Void: Setbalance (Getbalance .50)

The study guide covers three topics: two-dimensional arrays, inheritance, and interfaces. For two-dimensional arrays, students should be able to write a method that manipulates a two-dimensional array. For inheritance, students will write code for an inheritance hierarchy with a Savings subclass that extends an abstract Account superclass. The Account class contains name and balance fields and referenced methods, while the Savings subclass implements a deductFees method. For interfaces, students should apply a user-written interface to a concrete class.

Uploaded by

theomega76
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSCD211 Programming Principles II 4/27/2014

Exam 1 Study Guide

Two dimensional arrays

Be able to write a complete Java method that will manipulate a two-dimensional array.

Inheritance

Youll be asked to write code to develop an inheritance hierarchy (super class / sub class.)

Given the Savings sub-class that follows, create the super-class named Account:

Make the Account class abstract.


Data variables in the Account class are name (type String which can be accessed
directly by the sub-class but not by the outside world,) and balance (type double which
cannot be accessed by any sub-class.)
Add the methods that are referenced in the Savings sub-class.
Make it so that the deductFees method is known to the Account class, but the
implementation for deductFees is required to be in the Savings class.

public class Savings extends Account


{
public Savings(String name, double balance)
{
super(name, balance);
}
public void deductFees()
{
setBalance(getBalance() * .50);
}
public String toString()
{
// Show the account type, depositor's name and balance...
return "Savings account for " + super.toString();
}
}

// Create your Account class here

Be familiar with the rules regarding inheritance (T/F questions.)

Interfaces

Be able to apply a user-written interface to a concrete implementation.

Exceptions

True / False questions about the rules of exception handling, exception-related Java reserved
words, inheritances in exceptions, etc.

You might also like