Java compile problem

  • 13 years ago
    I have been trying to compile a java bean using javac from within Fedora Linux 5.  I compiled the first bean creating a class succesfully but the second keeps on coming up with an error.  Both java files are stored in WEB-INF/classes/beans

    Here is my code:


    //file location /WEB-INF/classes/awpica

    package beans;

    public class ItemOrder implements{

        private String name;

        public ItemOrder() {
            name = null;       

        public String getName(){return name;}
        public void setName(String s){name = s;}

        public boolean isValid()
            if ( ( name != null) )
                return true;
                return false;

    //end of class ItemOrder


    //file location /WEB-INF/classes/beans
    package beans;

    import java.util.ArrayList;

    public class BikeOrder implements{

    //instance variable
        private ArrayList cart;

        public BikeOrder() {   
            if (cart == null)
                cart = new ArrayList();

        public void setItem(ItemOrder o){cart.add(o);}
        public ArrayList getCart(){return cart;}

    //end of class

    When comiling the bike order the following error is produced -
    ItemOrder cannot be resolved to a type

    Many Thanks

  • 13 years ago
    You must use templates.

    If is in other package import this package in BikeOrder, and change the following:

    private ArrayList cart;


    private ArrayList ItemOrder cart;

    where ItemOrder is parameter of template, I DIDN'T MANAGE TO WRITE THIS SIGNS - < .Of course change the constructor of BikeOrder either

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.”