----jGRASP exec: javac -g C:\Documents and Settings\Home\Desktop\java programs\List3.java
 ----   at: Sep 11, 2010 9:15:23 PM

 ----jGRASP wedge: pid for wedge is 3808.
 ----jGRASP wedge2: pid for wedge2 is 3800.
 ----jGRASP wedge2: CLASSPATH is ".;;.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\Program Files\jgrasp\extensions\classes".
 ----jGRASP wedge2: working directory is [C:\Documents and Settings\Home\Desktop\java programs] platform id is 2.
 ----jGRASP wedge2: actual command sent ["C:\Program Files\Java\jdk1.6.0\bin\javac.exe" -g "C:\Documents and Settings\Home\Desktop\java programs\List3.java"].
 ----jGRASP wedge2: pid for process is 3904.

C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
        ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
               ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                   ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                     ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                      ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                        ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                         ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                            ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                                   ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                                    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                                     ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:37: case, default, or '}' expected
        while( int i=0;i<arr.length;i++)
                                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:39: orphaned case
    case 1:System.out.println("Enter the smallest number for list1");
    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:47: not a statement
             breal;
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: illegal start of expression
    case 4:public void display(){
           ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: case, default, or '}' expected
    case 4:public void display(){
                  ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: case, default, or '}' expected
    case 4:public void display(){
                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: case, default, or '}' expected
    case 4:public void display(){
                              ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: case, default, or '}' expected
    case 4:public void display(){
                               ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:48: case, default, or '}' expected
    case 4:public void display(){
                                ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                 ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                     ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                      ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                        ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                         ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                          ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                           ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                              ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                               ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                                     ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                                      ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:49: case, default, or '}' expected
             for(int i=0;i<arr.length;i++)
                                         ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                   ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                        ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                               ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                   ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                     ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                      ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                         ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:50: case, default, or '}' expected
             System.out.println(arr[i]+"");
                                          ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                   ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                       ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                        ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                               ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                                ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:51: case, default, or '}' expected
             System.out.println();
                                 ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:52: while expected
             }
              ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:53: illegal start of expression
    case 5:2:System.out.println("Smallest of list1="+list1.smallest());
    ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:53: not a statement
    case 5:2:System.out.println("Smallest of list1="+list1.smallest());
           ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:53: ';' expected
    case 5:2:System.out.println("Smallest of list1="+list1.smallest());
            ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:58: not a statement
             breal;
             ^
C:\Documents and Settings\Home\Desktop\java programs\List3.java:60: reached end of file while parsing
    case 6: //is should be the quit i dont how to make it
           ^
68 errors

 ----jGRASP wedge2: exit code for process is 1.
 ----jGRASP: operation complete.

Edited 3 Years Ago by mike_2000_17: Fixed formatting

You have misplaced lots of '}' and '{'. You haven't some of those and you have opened others where you shouldn't. Review your code and check those brackets.

i still have an errors i already check it please do cheack and post it here if you got it right,because i was really stack in here...please help me

import java.util.*;

public class List3{
private final int [] arr;
private final int MAX=10;

    public List3(){
    arr=new int[MAX];
    }//ACCEPT 10 NUMBERS
    public void accept(){
    Scanner console=new Scanner(System.in);
    for(int i=0;i<arr.length;i++)
    arr[i]=console.nextInt();
    }
        public int smallest(){
        int smallest=0;
        for(int i=0;i<arr.length;i++)
        smallest=Math.min(smallest,arr[i]);
        return smallest;
        }   
            public int largest(){
            int largest=0;
            for(int i=0;i<arr.length;i++)
            largest=Math.max(largest,arr[i]);
            return largest;
            }
        public int sum(){
        int sum=0;
        for(int i=0;i<arr.length;i++)
        sum+=arr[i];
        return sum;
        }//main
        public static void main(String [] args){

    do 

    while((userChoice != EXIT_LOOP_NUMBER))

switch(userChoice);
    case 1:System.out.println("Enter the smallest number for list1");
             System.out.println("Enter the largest number for list1");
             break;
    case 2:System.out.println("Smallest of list1="+list1.smallest());
             System.out.println("Largest of list1="+list1.largest());
             break;
    case 3:System.out.println("Smallest of list2="+list2.smallest());
             System.out.println("Largest of list2="+list2.largest());
             break;
    case 4:public void display(){
             for(int i=0;i<arr.length;i++)
             System.out.println(arr[i]+"");
             System.out.println();

             break;
             }
    case 5:2:System.out.println("Smallest of list1="+list1.smallest());
             System.out.println("Largest of list1="+list1.largest());
             break;
             System.out.println("Smallest of list2="+list2.smallest());
             System.out.println("Largest of list2="+list2.largest());
             break;

    case 6: //is should be the quit i dont how to make it

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Use code tags and post your whole code. Don't tell me you stopped at case 6 and haven't closed anything. If you don't know how to do it then don't. But at least close all the unclosed brackets.
Next time when you open one, immediately close it and then write between.

Also the same code was posted in another thread. Wait until you get all the answers to the other thread before opening a new one. If the code doesn't work in one thread wait until it's fixed before posting a new question to another.

ok...yeah i well just post to case 6:i well have just stop in there I just forgot to put a close bracket in there..please do try to help what is the problem of my code..

Stop replying to 2 threads. Have only one and use code tags.
Press the code button when making a new post and place your coded inside the the 2 code tags.

Edited 3 Years Ago by happygeek: fixed formatting

This article has been dead for over six months. Start a new discussion instead.