Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi friends, when i am trying to execute the below java program,getting an errors like
"
Main.java:6: ‘)’ expected
 public void go(String… y, int x) {
 ^
Main.java:6: ‘;’ expected
 public void go(String… y, int x) {
 ^
2 errors"


java code is

Java
public class Demo
{
    public static void main(String args[])
    {
        new Demo().go("hi",1);
        new Demo().go("hi","world",2);
    }
    public void go(String y,int x)
    {
        System.out.print(y[y.length-1]+"");
    }
}

please help me,i am new to java

thanks in advance.
Posted
Updated 21-Jan-13 23:16pm
v2
Comments
Sergey Alexandrovich Kryukov 22-Jan-13 2:15am    
What is unclear in these error messages, exactly? Did you try on related topic of the syntax?
—SA

1 solution

Your code makes little sense. Spend some time studying the Java Tutorials[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900