Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #3086

error message at compiled time <identifier>expected on line 4 &5.

Newsgroups comp.lang.java.help
Date 2014-11-07 07:43 -0800
Message-ID <6fcbfae7-ecb3-4701-bfde-d56f3f82e2f9@googlegroups.com> (permalink)
Subject error message at compiled time <identifier>expected on line 4 &5.
From abiolaquadri1987@gmail.com

Show all headers | View raw


public class NestIFElevator {
    public boolean openDoor = false;
    public int currentFloor = 1;
    public Final int TOP_FLOOR = 10;
    public Final int MIN_FLOOR = 1;
    
    public void doorOpen(){
        System.out.println("Opening Door");
        openDoor = true;
        System.out.println("Door is Open");
    }
    public void closeDoor(){
        System.out.println("Closing Door");
        openDoor = false;
        System.out.println("Door is Close");
    }
    public void goUp(){
        System.out.println("Going up 1 floor");
        currentFloor++;
        System.out.println("Floor:" +currentFloor);
        if(currentFloor == TOP_FLOOR){
            System.out.println("Cannot go up");
        }
        else{
            openDoor = true;
            System.out.println("Door is Open");
        }
        public void goDown(){
            
            if(currentFloor == MIN_FLOOR){
                System.out.println("Cannot go down");
            }
            if(currentFloor > MIN_FLOOR){
                if(!openDoor){
                    System.out.println("Going Down 1 Floor.");
                    currentFloor--;
                    System.out.println("Floor:"+currentFloor);
                }
            }
                
            }
        }
        
    

    

Back to comp.lang.java.help | Previous | NextNext in thread | Find similar


Thread

error message at compiled time <identifier>expected on line 4 &5. abiolaquadri1987@gmail.com - 2014-11-07 07:43 -0800
  Re: error message at compiled time <identifier>expected on line 4 &5. Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-11-07 10:50 -0500

csiph-web