File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 15080

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: 4542

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: 46320
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!