#i have 2 errors

1 messages · Page 1 of 1 (latest)

white sable
#

Error: Type mismatch: cannot convert from java.lang.String to String
this error happens whenever i try to do something related to string for example: "String sc = sc.nextLine();" or "String s1 = "Enter a number"", this error happens during compiling.
Static Error: This class does not have a static void main method accepting String[].
this error doesnt show when compiling, but rather when running a code, for example:
"import java.util.Scanner;
public class testing
{
public static void main (String [] args)
{
Scanner sc = new Scanner (System.in);
System.out.println (2+3);
}
}"
since there is no code like "String sc = sc.nextLine()" or "String s1 = "Enter a number"" in the second code, the first error doesnt occur.
i need help troubleshooting

devout scrollBOT
#

<@&987246399047479336> please have a look, thanks.

unborn patio
#

what program are u using to code ?

white sable
#

Dr java

#

@unborn patio

#

I know it is not a code error, I don't know what's causing this issue, googling or chat gpt couldn't help me with the situation

red halo
#

We recommend using a good IDE like intellij CE.

devout scrollBOT
white sable
#

let me try this real quick

distant flicker
#

Did you create a class named String?

white sable
white sable
proud inlet
#

why?

white sable
#

I was studying the string chapter of my course and since there are 3 parts, each are named string _1 string_2 and so on

proud inlet
#

well but did you create a class thats called String just like the existing string class in java?

white sable
#

Just string? No

proud inlet
#

then idk

#

I thought you maybe had a name class by creating a class called String

white sable
#

Well it's fixed tho, so I should close this thread

#

Thanks for the help everyone

white sable
red halo