Current Forum: Homework 5 - Parts 1 and 2 |
Date: Sat Nov 10 2001 11:20 pm |
Author: Goodman, Brian J. <bjg@andrew.cmu.edu> |
Subject: Re: understanding and encouragement |
|
|
Yes, you can certainly declare private data in a class that implements an interface. The interface won't specify anything related to this data because interfaces have no private data. In fact they have no data. So any implementing class can have data members, regardless of the interface. You just need to be careful that they get initialized (probably easiest to do in your constructor(s)). |
|