Results 1 to 2 of 2
  1. #1
    dirtycash is offline Member
    Join Date
    Nov 2007
    Posts
    38
    Rep Power
    0

    Default simple problem - code wont compile

    Java Code:
    public class Hotel {
        public static final int ROOM_PRICE = 20;
        public static final int SEAVIEW_SUPPLEMENT = 5;
        public static final int SINGLE_OCCUPIER_SUPPLEMENT = 5;
        public static final int DINNER_PRICE = 9;
    
        //declaring
        private Room[] array1;
        
        //An integer value representing the amount of money the hotel taken.
        private int hotelMoney = 0;
        
        //declaring 
        private static int freeRooms=number of rooms available in the hotel;
        
        //An integer value indicating the amount of free rooms available.
        public void freeRooms() 
        {
            freeRooms=freeRooms-1;
        }
    }
    it says a ";" is expected and highlights the following:
    Java Code:
    private static int freeRooms=number of rooms available in the hotel;
    any help would be appreciated.

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

    Default

    //declaring
    private static int freeRooms; //number of rooms available in the hotel

Similar Threads

  1. Replies: 3
    Last Post: 12-12-2008, 12:12 PM
  2. Peculiarty in code of simple program...
    By Kreuz14 in forum New To Java
    Replies: 4
    Last Post: 01-23-2008, 03:27 AM
  3. simple code
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:49 PM
  4. Replies: 2
    Last Post: 08-06-2007, 09:16 PM
  5. problem with a simple java code
    By boy22 in forum New To Java
    Replies: 2
    Last Post: 08-03-2007, 02:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •