Class can have its own variables. They are called fields.
class Rectangle {
int Width;
int Height;
}
Here the width and height are fields of Rectangle type.
Fields can have the following modifiers:
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |