954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem with Boolean argument

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

luisator
Newbie Poster
21 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

Since it's abstract shouldn't you override that method and implement your own version, instead of calling that method?

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 
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

luisator
Newbie Poster
21 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

I think
It should be
recordingActivation = new Boolean("true");
instead of
recordingActivation = new Boolean(true);

niksinghania
Newbie Poster
1 post since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

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.4.2/docs/api/java/lang/Boolean.html

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

I doubt the OP is going to return after six years to post his classes. ;)

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 
I doubt the OP is going to return after six years to post his classes. ;)

Ups, I never thought thatniksinghania would go and post a "solution" to a 6-year-old thread

javaAddict
Nearly a Senior Poster
Team Colleague
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
 

no it would be (true) not ("true")

I think It should be recordingActivation = new Boolean("true"); instead of recordingActivation = new Boolean(true);
Progr4mmer
Junior Poster
113 posts since Nov 2009
Reputation Points: 11
Solved Threads: 10
 

same didnt even notice is was from 5 years ago since it was at the top

Ups, I never thought that niksinghania would go and post a "solution" to a 6-year-old thread
Progr4mmer
Junior Poster
113 posts since Nov 2009
Reputation Points: 11
Solved Threads: 10
 

>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.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

>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.


yeah sorry but how would the first guy even find a thread to reopen from 5 years ago

Progr4mmer
Junior Poster
113 posts since Nov 2009
Reputation Points: 11
Solved Threads: 10
 

Google or perhaps "Similar Threads" listing.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 
Google or perhaps "Similar Threads" listing.


... could this thread be closed lol to prevent further posting?

Progr4mmer
Junior Poster
113 posts since Nov 2009
Reputation Points: 11
Solved Threads: 10
 

Yes, I think this thread has probably served its time.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You