3 Replies - 5748 Views - Last Post: 10 November 2009 - 06:51 PM Rate Topic: -----

#1 zanyrogue  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 16-January 09

What does protected mean? and what does it do?

Post icon  Posted 10 November 2009 - 09:16 AM

Hi,

Could somebody explain to me what protected means in the context of Java Swing and also exactly what it does?

Somebody has given me an example of a program to explain how to use the mediaTraker and they have used protected quite a bit in its construction.

protected void init(DummyComponent component, int rows, int cols) throws InterruptedException {
			this.cols = cols;
			this.rows = rows;
			this.imgSlice = new Image[rows][cols];



Is This A Good Question/Topic? 0
  • +

Replies To: What does protected mean? and what does it do?

#2 jtphenom  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 129
  • Joined: 06-November 09

Re: What does protected mean? and what does it do?

Posted 10 November 2009 - 09:22 AM

View Postzanyrogue, on 10 Nov, 2009 - 08:16 AM, said:

Hi,

Could somebody explain to me what protected means in the context of Java Swing and also exactly what it does?

Somebody has given me an example of a program to explain how to use the mediaTraker and they have used protected quite a bit in its construction.

protected void init(DummyComponent component, int rows, int cols) throws InterruptedException {
			this.cols = cols;
			this.rows = rows;
			this.imgSlice = new Image[rows][cols];


Making something protected means it can be accessed by all classes related to it by inheritance.

Here's more!
Was This Post Helpful? 0
  • +
  • -

#3 zanyrogue  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 91
  • Joined: 16-January 09

Re: What does protected mean? and what does it do?

Posted 10 November 2009 - 09:34 AM

Ah that explains alot! When I removed protected when I was trying to find out what it does some of the classes didn't work.

I was looking for it to do something a little more complicated than it does.

Thanks for that. :D :^:
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: What does protected mean? and what does it do?

Posted 10 November 2009 - 06:51 PM

View Postzanyrogue, on 10 Nov, 2009 - 08:34 AM, said:

Ah that explains alot! When I removed protected when I was trying to find out what it does some of the classes didn't work.

I was looking for it to do something a little more complicated than it does.

Thanks for that. :D :^:

protected means that it can be accessed by all classes in the same package and it is the default....
so removing "protected" (which is the default) shouldn't change anything... your problem must be somewhere else
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1