+ 1
Codes that runs fine in Playground won't work in Eclipse
In Eclipse, this code throws the error "Type mismatch: cannot convert from java.lang.String to test5.String", while here runs perfectly fine. Here are the codes: https://code.sololearn.com/cwVdGhCSgDnb https://code.sololearn.com/cqMvwu11l0lh Thanks in advance for any help!
5 Answers
+ 2
Sololearn ide for non web codes is very limited.
E.g.
You can't input data sequentially but you have to input it all at once.
I recommend you make the codes first in eclipse and then trying them here.
+ 1
Double check your imports as Eclipse does some automatically, or you may have some files from another part of a project that is being used as an import. It thinks the 'String' declaration in your code is some other class
+ 1
Based on your error message it sounds like an import thing, maybe copy paste your code exactly as it appears in eclipse. default package is basically no package. Maybe there is a package private class you've made that is causing the conflict. The imports are usually folded away on eclipse so you won't be able to see what's changing as you move and save the files
0
The thing is, that when I moving the class to "default" package it works perfectly fine. What is that?
0
The problem was in the class's name. Thank everyone for the help!
If you don't mind, can you, please, take a look at this question?
https://www.sololearn.com/Discuss/1355241/java-how-to-remove-the-word-variable-from-the-output
Thanks!