please help me to correct the followin java code

// hello i got some errors in the code below, and i dont understand how to correct so please guide me

import java.util.Scanner;

public class Task72
{
    public static void main(String[] args)
    {
        String [] entry=new String[10];

        input(entry);
        display(entry);
        check(entry);

    public static input(String []urentry)
        {
            System.out.println("Enter ten text entry");
           
            for(i=0; i<10;i++)
            {
            Scanner scan=new Scanner(System.in);
            urentry[i]=scan.nextLine();
            }
        }
           
        public static display(String []urdisplay)
            {
       
            for(int q =0; q<10; q++)
                {
                  System.out.println("Here is your entry, please check it : "+display[i]);
                }   
   
            }
        public static check(String []chs)

            {
                   
           
             System.out.print("Enter the test that you want to check,");
            System.out.println(" Either it is present in your entry or not");
            String checkEntry= scan.nextLine();
           
            for(int s=0; s<10;s++)
                 {
                               if(checkEntry.compareTo(chs[s]==0))
                       System.out.prinlln("The enrty "+checkEntry+" is present in the enrty");
                  else
                System.out.prinlln("The enrty "+checkEntry+" is not present in the enrty");
                   
                }
            }
    }

}
           
       
               
//

and the error says Task72.java:25: '.class' expected
                public static void display( String []display)
                                                     ^
Task72.java:25: ';' expected
                public static void display( String []display)
                                                            ^
Task72.java:34: illegal start of expression
                public class static void check( String []chs)
                ^
Task72.java:34: <identifier> expected
                public class static void check( String []chs)
                            ^
Task72.java:48: reached end of file while parsing
                                System.out.prinlln("The enrty "+checkEntry+" is
not present in the enrty");

                           ^
Task72.java:54: reached end of file while parsing

^
14 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
        ^
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
               ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                     ^
Task72.java:14: '.class' expected
        public static void input( String []urentry)
                                           ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                                                  ^
Task72.java:25: illegal start of expression
                public static void display( String []display)
                ^
Task72.java:25: illegal start of expression
                public static void display( String []display)
                       ^
Task72.java:25: ';' expected
                public static void display( String []display)
                             ^
Task72.java:25: '.class' expected
                public static void display( String []display)
                                                     ^
Task72.java:25: ';' expected
                public static void display( String []display)
                                                            ^
Task72.java:34: illegal start of expression
                public  static void check( String []chs)
                ^
Task72.java:34: illegal start of expression
                public  static void check( String []chs)
                        ^
Task72.java:34: ';' expected
                public  static void check( String []chs)
                              ^
Task72.java:34: '.class' expected
                public  static void check( String []chs)
                                                    ^
Task72.java:34: ';' expected
                public  static void check( String []chs)
                                                       ^
Task72.java:48: reached end of file while parsing
                                System.out.prinlln("The enrty "+checkEntry+" is
not present in the enrty");

                           ^
Task72.java:54: reached end of file while parsing

^
17 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
        ^
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
               ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                     ^
Task72.java:14: '.class' expected
        public static void input( String []urentry)
                                           ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                                                  ^
Task72.java:25: illegal start of expression
                public static void display( String []urdisplay)
                ^
Task72.java:25: illegal start of expression
                public static void display( String []urdisplay)
                       ^
Task72.java:25: ';' expected
                public static void display( String []urdisplay)
                             ^
Task72.java:25: '.class' expected
                public static void display( String []urdisplay)
                                                     ^
Task72.java:25: ';' expected
                public static void display( String []urdisplay)
                                                              ^
Task72.java:34: illegal start of expression
                public static void check( String []chs)
                ^
Task72.java:34: illegal start of expression
                public static void check( String []chs)
                       ^
Task72.java:34: ';' expected
                public static void check( String []chs)
                             ^
Task72.java:34: '.class' expected
                public static void check( String []chs)
                                                   ^
Task72.java:34: ';' expected
                public static void check( String []chs)
                                                      ^
Task72.java:48: reached end of file while parsing
                                System.out.prinlln("The enrty "+checkEntry+" is
not present in the enrty");

                           ^
Task72.java:54: reached end of file while parsing

^
17 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
        ^
Task72.java:14: illegal start of expression
        public static void input( String []urentry)
               ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                     ^
Task72.java:14: '.class' expected
        public static void input( String []urentry)
                                           ^
Task72.java:14: ';' expected
        public static void input( String []urentry)
                                                  ^
Task72.java:25: illegal start of expression
                public static void display( String []urdisplay)
                ^
Task72.java:25: illegal start of expression
                public static void display( String []urdisplay)
                       ^
Task72.java:25: ';' expected
                public static void display( String []urdisplay)
                             ^
Task72.java:25: '.class' expected
                public static void display( String []urdisplay)
                                                     ^
Task72.java:25: ';' expected
                public static void display( String []urdisplay)
                                                              ^
Task72.java:34: illegal start of expression
                public static void check( String []chs)
                ^
Task72.java:34: illegal start of expression
                public static void check( String []chs)
                       ^
Task72.java:34: ';' expected
                public static void check( String []chs)
                             ^
Task72.java:34: '.class' expected
                public static void check( String []chs)
                                                   ^
Task72.java:34: ';' expected
                public static void check( String []chs)
                                                      ^
15 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:14: illegal start of expression
        public static input( String []urentry)
        ^
Task72.java:14: illegal start of expression
        public static input( String []urentry)
               ^
Task72.java:14: ';' expected
        public static input( String []urentry)
                           ^
Task72.java:14: ';' expected
        public static input( String []urentry)
                                             ^
Task72.java:25: illegal start of expression
                public static display( String []urdisplay)
                ^
Task72.java:25: illegal start of expression
                public static display( String []urdisplay)
                       ^
Task72.java:25: ';' expected
                public static display( String []urdisplay)
                                     ^
Task72.java:25: ';' expected
                public static display( String []urdisplay)
                                                         ^
Task72.java:34: illegal start of expression
                public static check( String []chs)
                ^
Task72.java:34: illegal start of expression
                public static check( String []chs)
                       ^
Task72.java:34: ';' expected
                public static check( String []chs)
                                   ^
Task72.java:34: ';' expected
                public static check( String []chs)
                                                 ^
12 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:13: illegal start of expression
        public static input( String []urentry)
        ^
Task72.java:13: illegal start of expression
        public static input( String []urentry)
               ^
Task72.java:13: ';' expected
        public static input( String []urentry)
                           ^
Task72.java:13: ';' expected
        public static input( String []urentry)
                                             ^
Task72.java:24: illegal start of expression
                public static display( String []urdisplay)
                ^
Task72.java:24: illegal start of expression
                public static display( String []urdisplay)
                       ^
Task72.java:24: ';' expected
                public static display( String []urdisplay)
                                     ^
Task72.java:24: ';' expected
                public static display( String []urdisplay)
                                                         ^
Task72.java:33: illegal start of expression
                public static check( String []chs)
                ^
Task72.java:33: illegal start of expression
                public static check( String []chs)
                       ^
Task72.java:33: ';' expected
                public static check( String []chs)
                                   ^
Task72.java:33: ';' expected
                public static check( String []chs)
                                                 ^
12 errors

C:\Users\hari krishna\Desktop\javawork>javac Task72.java
Task72.java:13: illegal start of expression
        public static input(String []urentry)
        ^
Task72.java:13: illegal start of expression
        public static input(String []urentry)
               ^
Task72.java:13: ';' expected
        public static input(String []urentry)
                           ^
Task72.java:13: ';' expected
        public static input(String []urentry)
                                            ^
Task72.java:24: illegal start of expression
                public static display(String []urdisplay)
                ^
Task72.java:24: illegal start of expression
                public static display(String []urdisplay)
                       ^
Task72.java:24: ';' expected
                public static display(String []urdisplay)
                                     ^
Task72.java:24: ';' expected
                public static display(String []urdisplay)
                                                        ^
Task72.java:33: illegal start of expression
                public static check(String []chs)
                ^
Task72.java:33: illegal start of expression
                public static check(String []chs)
                       ^
Task72.java:33: ';' expected
                public static check(String []chs)
                                   ^
Task72.java:33: ';' expected
                public static check(String []chs)
                                                ^
12 errorr

//

please help me some body

Tags

Hello hkm; As from your code it appears that the methods don't have a return type: public static input(String []urentry) ---->public static void input(String [] urentry) {}..and so forth and so on...Thanks.

yaar u hv passed a non-static data member to a satic member function so it's going wrong yaar

Add new comment