The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
December 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

No, that's just a typo in my posting.

Posted by Christian Schmitt on December 08, 2000 at 3:19 AM

> A very small mistake you are doing is declaring variable b as a parameter of method f as well as an object of class B. So just change one of the variable name and you are fine.

> public void f(String s, boolean b){
> B b = new B(s,b); // Duplicate b
> ...
> }

> Change To

> public void f(String s, boolean b){
> B b1 = new B(s,b); // Duplicate b
> ...
> }

>

Hi,

sorry, but as i said in the headline, this is a typo in my posting, not in my original code. As you could have guessed because as i said, my code works if i declare B public, and because of the compiler-error i get if B is declared protected.
Maybe you can help me though?

Thanks,
Chris





Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us