This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes SCJP Difficulty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SCJP Difficulty" Watch "SCJP Difficulty" New topic

SCJP Difficulty

Shreyansh Singh

Joined: Jun 22, 2011
Posts: 2

While running the following Program on NetBeans ,I am getting the following Error:

D:\JAVA\Java$Program\src\java$program\ cannot find symbol
symbol : constructor SCJP_Richard_Raposa_Pg_189_Buffalo(boolean)
location: class java$program.SCJP_Richard_Raposa_Pg_189_Buffalo
SCJP_Richard_Raposa_Pg_189_Buffalo b=new SCJP_Richard_Raposa_Pg_189_Buffalo(false);
1 error
BUILD FAILED (total time: 0 seconds)

Actual Program:-

Please somebody help me to rectify my mistake and if possible please explain my mistake...
Thank You in advance.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15041

Welcome to the Ranch.

The error message says that the compiler cannot find a constructor for the class SCJP_Richard_Raposa_Pg_189_Buffalo that takes a boolean as an argument.

Looking at your source code, your class SCJP_Richard_Raposa_Pg_189_Buffalo indeed does not have such a constructor. So, you'll have to add it.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Matthew Brown

Joined: Apr 06, 2010
Posts: 4541

That error message tells you that you're trying to use the constructor SCJP_Richard_Raposa_Pg_189_Buffalo(boolean) - on line 28 of the code above. But that class doesn't have a constructor that takes a boolean. Since you haven't defined a constructor the compiler will insert one, but it will insert one that takes no arguments.

So you either needs to change it to:or you need to add the missing constructor.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45305
And why are you using $ and _ symbols in your identifiers? That is not usually a recommended style.
I agree. Here's the link:
subject: SCJP Difficulty
It's not a secret anymore!