BestJewSinceJC
Posting Maven
2,772 posts since Sep 2008
Reputation Points: 874
Solved Threads: 354
static methods should be called like this...
ClassName.MethodName(params);
while your approach is trying to call the constructor.
it will be ....
className.ItemFound(pistol, "No other items found in Bedroom", "You found Pistol", txt);
Hi I am trying to return a boolean value into another method, but it's not working.
public static boolean ItemFound(boolean item, String desc1, String desc2, JTextArea txt){
if(item == true)
txt.setText(desc1);
if(item == false){
txt.setText(desc2);
item = true;
}
return item;
}
and inside the other method I have
new ItemFound(pistol, "No other items found in Bedroom", "You found Pistol", txt);
the error I get is:
cannot find symbol constructor ItemFound(boolean,java.lang.String,java.lang.String,javax.swing.JTextArea)
vchandra
Junior Poster in Training
73 posts since Mar 2010
Reputation Points: 13
Solved Threads: 14