0

Is there a way in java to do something similar to this:

class Rectangle
{
   public:
      int x;
      string y;

   private:
      int a;
      string b;
}

Or do you always have to specify public/private for each property?

Edited by Duki: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by harinath_2007
1

No..You cannot use the shortcut method. :)
You need to specify the access specifier for each member variable separately with patience..

But it will be nice if oracle make changes like what you have said..

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.