英文:
Error:(7, 22) java: ')' expected when executing my code
问题
我收到了以下错误:
> 在执行我的代码时出现错误:
public class Main {
public static void main(String[] args) {
// write your code here
myName( mName:"Gowtham");
}
public static void myName(String mName) {
System.out.println(mName);
}
}
这是我想要执行的代码,但它指出有错误,是通过一些在线课程学习的。
英文:
I receive the following error:
> Error:(7, 22) java: ')' expected when executing my code:
public class Main {
public static void main(String[] args) {
// write your code here
myName( mName:"Gowtham");
}
public static void myName(String mName) {
System.out.println(mName);
}
}
This is the code I wanted to execute but it tells it has errors, learning it through some online courses.
答案1
得分: 1
错误在这里:
myName( mName:"Gowtham");
请按照以下方式编写:
public class Main {
public static void main(String[] args) {
// write your code here
myName("Gowtham");
}
public static void myName(String mName) {
System.out.println(mName);
}
}
英文:
The error is here
myName( mName:"Gowtham");
Just write it as following:
public class Main {
public static void main(String[] args) {
// write your code here
myName("Gowtham");
}
public static void myName(String mName) {
System.out.println(mName);
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论