943,965 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1859
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
Apr 20th, 2005
0

Problem with Boolean argument

Expand Post »
Hi everyone!!!
I am newbie in java programming, I am using a communication API. I am havin some problems. Iwant to use a method defined like this:

enableRecording
public abstract void enableRecording(DeviceID device,
Boolean immediatelyActive)
throws CstaException

and for that I am doing the following:

recordingActivation = new Boolean(true);
enableRecording(id, recordingActivation);

I get this error:

../src/sampleapps/tutorial/PrimerApp.java:226: cannot resolve symbol
symbol : method enableRecording (ch.ecma.csta.binding.DeviceID,java.lang.Boolean)
location: class PrimerApp
enableRecording(id, recordingActivation);
^
1 error

Can anybody help with this??? I've tried lot of things but I really don't know what else to try
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
luisator is offline Offline
21 posts
since Apr 2005
Apr 20th, 2005
0

Re: Problem with Boolean argument

Since it's abstract shouldn't you override that method and implement your own version, instead of calling that method?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Apr 20th, 2005
0

Re: Problem with Boolean argument

Quote originally posted by server_crash ...
Since it's abstract shouldn't you override that method and implement your own version, instead of calling that method?
Sorry mi ignorance, how do I override a method inside myclass? I think that is the point but I don't know how to do that
Reputation Points: 10
Solved Threads: 0
Newbie Poster
luisator is offline Offline
21 posts
since Apr 2005
Feb 25th, 2011
0
Re: Problem with Boolean argument
I think
It should be
recordingActivation = new Boolean("true");
instead of
recordingActivation = new Boolean(true);
Reputation Points: 10
Solved Threads: 0
Newbie Poster
niksinghania is offline Offline
1 posts
since Aug 2009
Feb 25th, 2011
0
Re: Problem with Boolean argument
We need to see more code. Post your classes. We need to see how they are declared, which are abstract and how you override your abstract methods.

And niksinghania the error clearly says that the problem is the enableRecording method (cannot resolve symbol) not how the Boolean object is created. A look at the API shows that both ways are correct:
http://download.oracle.com/javase/1....g/Boolean.html
Sponsor
Featured Poster
Reputation Points: 1014
Solved Threads: 446
Nearly a Senior Poster
javaAddict is offline Offline
3,259 posts
since Dec 2007
Feb 25th, 2011
1
Re: Problem with Boolean argument
I doubt the OP is going to return after six years to post his classes.
Last edited by Ezzaral; Feb 25th, 2011 at 1:23 pm.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Feb 25th, 2011
0
Re: Problem with Boolean argument
Click to Expand / Collapse  Quote originally posted by Ezzaral ...
I doubt the OP is going to return after six years to post his classes.
Ups, I never thought that niksinghania would go and post a "solution" to a 6-year-old thread
Sponsor
Featured Poster
Reputation Points: 1014
Solved Threads: 446
Nearly a Senior Poster
javaAddict is offline Offline
3,259 posts
since Dec 2007
Feb 25th, 2011
0
Re: Problem with Boolean argument
no it would be (true) not ("true")

I think
It should be
recordingActivation = new Boolean("true");
instead of
recordingActivation = new Boolean(true);
Reputation Points: 11
Solved Threads: 10
Junior Poster
Progr4mmer is offline Offline
111 posts
since Nov 2009
Feb 25th, 2011
0
Re: Problem with Boolean argument
same didnt even notice is was from 5 years ago since it was at the top

Click to Expand / Collapse  Quote originally posted by javaAddict ...
Ups, I never thought that niksinghania would go and post a "solution" to a 6-year-old thread
Reputation Points: 11
Solved Threads: 10
Junior Poster
Progr4mmer is offline Offline
111 posts
since Nov 2009
Feb 25th, 2011
0
Re: Problem with Boolean argument
>same didnt even notice is was from 5 years ago since it was at the top
If you had read the responses to the thread though, you would have seen those last two before you and realized it was an old, dead thread.

It's always a good idea to actually read the thread before posting so that you have the full context of what has already been said.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: NullPointerException
Next Thread in Java Forum Timeline: JDK





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC