Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why this error come from cmd #71

Open
malithaofficail opened this issue Dec 23, 2022 · 5 comments
Open

why this error come from cmd #71

malithaofficail opened this issue Dec 23, 2022 · 5 comments

Comments

@malithaofficail
Copy link

sublime

public class helloWorld{

public static void main(string[] args){
	system.out.println("hello world! It's me malitha!");

  

}

}

cmd ,

C:\Users\user\Desktop\linkedin\java\java>javac helloWorld.java
helloWorld.java:3: error: cannot find symbol
public static void main(string[] args){
^
symbol: class string
location: class helloWorld
helloWorld.java:4: error: package system does not exist
system.out.println("hello world! It's me malitha!");
^
2 errors

@mgiita
Copy link

mgiita commented Feb 27, 2023

Hello!
3Line string[] → String
4Line  system → System
Uppercase and lowercase letters are judged separately.

@MarleySetwaba
Copy link

Wrong Syntax and Capitalize The String

Correct Code.

public static void main(String[] args)
{
system.out.println("hello world, it's me Matilda");
}

@Rishabh-Ethicalhacker
Copy link

Code :

public static void main(String[] args)
{
System.out.println("hello world! It's me malitha!");
}

Also calitalize the word String

@krushnapriyadas
Copy link

Correct Code:

public class helloWorld{
public static void main(String[] args){
System.out.println(" hello world! It's me malitha!");
}
}

Java is case-sensitive ,so its important to pay attention to the casing of your variables, class names, and important statements. so here in your code capitalize the String-S and also the System-S.

@jeetu-g2-1
Copy link

The errors in your Java program are due to some syntax and case sensitivity issues. Here's the corrected code:
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world! It's me Malitha!"); } }
**Let's go over the corrections:

The class name should start with an uppercase letter. In this case, it should be "HelloWorld" instead of "helloWorld."

The main method should have a capital 'S' in "String" and proper capitalization.

The System class should also have a capital 'S,' and the println method should be called using System.out.println().

After making these changes, you should be able to compile and run your program without any errors.**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants