This site requires JavaScript, please enable it in your browser!
Greenfoot back
erdelf
erdelf wrote ...

2013/1/7

Compile error?

erdelf erdelf

2013/1/7

#
I wrote a bit code but then I get a compile error with a line I compiled several times before and it worked. Here is the error: actual argument java.lang.String cannot be converted to String by method invocation conversion. I need help.
danpost danpost

2013/1/7

#
What is the complete error message and the code surrounding the line it happened? Also, you may want to insert the following before the line the error happened:
System.out.println(stringName);
for each possible String value that could be causing the error.
erdelf erdelf

2013/1/7

#
I want to create a new object in this line, you maybe remember our last discussion, it is the bar you made. The constructor needs string arguments, but java says me now that String and java.lang.String are not the same.
danpost danpost

2013/1/7

#
I asked that the code to the Bar object not be changed; that you can sub-class it to modify the behaviour. You may have named another variable called 'String' or something that is messing with the code. Really, without any code posting, no-one could say.
erdelf erdelf

2013/1/7

#
oh damn, I know what the problem is, I forgot for a moment that the string class is an actual class and wrote a new class called String, sry for bothering you
You need to login to post a reply.