Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
+++Please Help Me
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
match  
View profile  
 More options Jun 29 1996, 3:00 am
Newsgroups: comp.lang.java
From: ma...@patrol.i-way.co.uk
Date: 1996/06/29
Subject: +++Please Help Me
Hello,
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Err or: Hotel.java:4: Undefined variable: running
                running = false;
                ^
Error:  Hotel.java:21: No variable running defined in class Elevator.
                if (!(NorthElevator.running))
                                   ^
Error:  Hotel.java:25: No variable running defined in class Elevator.
                if (!(SouthElevator.running))
                                   ^                                    
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++WHEN I TRIED TO COMPILE THE TEXT BELOW I GOT THE ERRORS ABOVE
CAN YOU SUGGEST WHAT TO DO ?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++clas s Elevator {
        boolean runnig = true;
        void shutDown() {
                running = false;
                }
}

class FrontDesk {
        private final int EVENING = 8;
        Elevator NorthElevator, SouthElevator;

        FrontDesk() {          //the class sonstructor
                NorthElevator = new Elevator();
                SouthElevator = new Elevator();
                }
        void maintenance(int time) {
                        if (time == EVENING)
                                NorthElevator.shutDown();
                        }
        void displayStatus() {   // code is very inefficient, but serves
a purpose
                        System.out.print("North Elevator is ");
                if (!(NorthElevator.running))
                        System.out.print("not ");
                        System.out.println("running.");
                System.out.print("South Elator is ");
                if (!(SouthElevator.running))
                        System.out.print( " not ");
                System.out.println("running.");
                        }
        }
public class Hotel {
        public static void main(String args[]) {
                FrontDesk lobby;
                lobby = new FrontDesk();

                System.out.println("It's &:00. Time to check the
elevators.");
                lobby.maintenance(7);
                lobby.displayStatus();

                System.out.println();
                System.out.println("It's 8:00. Time to check the
elavators.");
                lobby.maintenance(8);
                lobby.displayStatus();
        }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Geert Vernaeve  
View profile  
 More options Jun 30 1996, 3:00 am
Newsgroups: comp.lang.java
From: gvern...@eduserv1.rug.ac.be (Geert Vernaeve)
Date: 1996/06/30
Subject: Re: +++Please Help Me

ma...@patrol.i-way.co.uk wrote:

: CAN YOU SUGGEST WHAT TO DO ?
: class Elevator {
:       boolean runnig = true;

Try
a) changing "runnig" to "running" (forgot an n)
b) making the variable public, i.e. change the line into
        "public boolean running = true"
  (I don't know the scoping reules by heart, but it could be that the
  standard visibility is: not visible for other classes -- but I may
  be wrong...)

        Geert.

NEC SPE                  Geert.Verna...@rug.ac.be                   NEC METU
                         ge...@einstein.rug.ac.be
                    http://studwww.rug.ac.be/~gvernaev


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joseph Millar  
View profile  
 More options Jul 1 1996, 3:00 am
Newsgroups: comp.lang.java
From: jmil...@ftp.com (Joseph Millar)
Date: 1996/07/01
Subject: Re: +++Please Help Me

ma...@patrol.i-way.co.uk wrote:
> Error:     Hotel.java:4: Undefined variable: running
>            running = false;
>            ^
> Error:     Hotel.java:21: No variable running defined in class Elevator.
>            if (!(NorthElevator.running))
>                               ^

[snip!]

>class Elevator {
>    boolean runnig = true;

           ^^^^^^
This is mispelled, should be running...

--Joe

___________________________________________________________________
 Joseph A. Millar                            FTP Software, Inc.
 Software Engineer     Ph: (508) 684-6461    100 Brickstone Square
 jmil...@ftp.com       Fax:(508) 684-6992    Andover, MA  01810
 http://www.ftp.com                          USA


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Lavallee  
View profile  
 More options Jul 2 1996, 3:00 am
Newsgroups: comp.lang.java
From: mlava...@ViaNet.on.ca (Michael Lavallee)
Date: 1996/07/02
Subject: Re: +++Please Help Me

In <31D5A43F.2...@patrol.i-way.co.uk>, ma...@patrol.i-way.co.uk writes:
>CAN YOU SUGGEST WHAT TO DO ?
>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++cla ss Elevator {
>    boolean runnig = true;
>    void shutDown() {
>            running = false;

If this is just a simple cut and paste, then you should note that initially you've
decleared a boolean variable called "runnig" and then later referred to it as
"running".

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Blomberg  
View profile  
 More options Jul 3 1996, 3:00 am
Newsgroups: comp.lang.java
From: John Blomberg <jblomb...@lotus.com>
Date: 1996/07/03
Subject: Re: +++Please Help Me

You have a typo.  You wrote:

          boolean runnig = true;

And it should read:

          boolean running = true;

- jb

ma...@patrol.i-way.co.uk wrote:

Error:  Hotel.java:4: Undefined variable: running
                 running = false;
                 ^

 WHEN I TRIED TO COMPILE THE TEXT BELOW I GOT THE ERRORS ABOVE
 CAN YOU SUGGEST WHAT TO DO ?

class Elevator {
         boolean runnig = true;
         void shutDown() {
                 running = false;
                 }


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »