ClassD - r = nR; this.setN(nN); this.setM(nM); } public...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/** * The ClassD class <subclass * of classB> * @author Jeff Cox */ * public class ClassD extends ClassB { private double q; double r; public ClassD() { q = 0; r = 0; } public ClassD(double nQ, double nR) { q = nQ; r = nR; } public ClassD(double nQ, double nR, int nN, int nM) { q = nQ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r = nR; this.setN(nN); this.setM(nM); } public void setQ(double nQ) { q = nQ; } public void setR(double nR) { r = nR; } public double getR() { return r; } public double getQ() { return q; } public double calc() { return q * r; } }...
View Full Document

Ask a homework question - tutors are online