Multiple fields declaration

For the fields with the same type we can declare them together.


class Rectangle{
   int Width, Height;
}

They can share the same modifiers as well.


class Rectangle{
   public int Width, Height;

}
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.