Why does this not compile?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Why does this not compile?

  1. #1
    Join Date
    Apr 2006
    Posts
    8

    Why does this not compile?

    Can some please help me find out why this does not compile, please


    public abstract class buyer{
    //instance variables
    private String buyerName;
    private String buyerAddress;
    private Integer perviousPurchases;
    //constructor
    public Buyer (String input Name, String input Address, integer input previous purchases)
    {
    buyerName = inputName;
    buyerAddress = inputaddress;
    perviousPurchases = input previouspurchases;
    }
    //The next 3 methods are ACCESSOR methods
    public String getName(){
    return buyerName;
    }
    public String getAddress(){
    return buyerAddress;
    }
    public double get previouspurchases (){
    return perviousPurchases;
    }
    //The next 3 methods are SETTING methods
    public void setName(String newName){
    buyerName = newName;
    }
    public void setAddress (String newAddress){
    buyerAddress = newAddress;
    }
    public void set perviousPurchases (integer new perviousPurchases){
    perviousPurchases = new perviousPurchases;
    }
    //other methods
    public double calculateDiscount(int carsToBePurchased)
    // will be used to calculate discount

    public Boolean equals( input test)
    {
    if this.name = input name; &
    if this.address = input address;
    result= true;
    return result
    }

    public void showDetails(){
    System.out.println("buyer Name is : " + this.getbuyerName() );
    System.out.println("buyer address is : " + this.getbuyeraddress() );
    }

    }//End of class definition

  2. #2
    Join Date
    Apr 2006
    Posts
    28
    How java can compile your program when a program
    still has a lot of syntax error EX:
    String input Name, String input Address, integer input previous purchases

Similar Threads

  1. compile error - servlet not found
    By hugh in forum Java
    Replies: 4
    Last Post: 02-09-2006, 07:53 AM
  2. Replies: 7
    Last Post: 11-30-2005, 09:49 AM
  3. Replies: 0
    Last Post: 01-27-2001, 03:29 PM
  4. How to compile Servlets?
    By DonM in forum Java
    Replies: 1
    Last Post: 01-27-2001, 03:04 PM
  5. How compile servlets ?
    By Giorgio in forum Java
    Replies: 2
    Last Post: 11-02-2000, 07:06 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center