Click here to Skip to main content
15,921,113 members
Home / Discussions / Java
   

Java

 
GeneralRe: A Collection is not thread-safe? Pin
Branislav Vidovic28-Sep-10 20:58
Branislav Vidovic28-Sep-10 20:58 
GeneralRe: A Collection is not thread-safe? Pin
Richard MacCutchan28-Sep-10 21:23
mveRichard MacCutchan28-Sep-10 21:23 
QuestionThreads and UML Pin
Neo1010127-Sep-10 6:27
Neo1010127-Sep-10 6:27 
AnswerRe: Threads and UML Pin
DaveAuld27-Sep-10 9:57
professionalDaveAuld27-Sep-10 9:57 
GeneralRe: Threads and UML Pin
David Skelly27-Sep-10 22:50
David Skelly27-Sep-10 22:50 
GeneralRe: Threads and UML Pin
DaveAuld27-Sep-10 23:58
professionalDaveAuld27-Sep-10 23:58 
AnswerRe: Threads and UML Pin
David Skelly27-Sep-10 22:59
David Skelly27-Sep-10 22:59 
QuestionArrayList Pin
future383927-Sep-10 2:28
future383927-Sep-10 2:28 
Hello,
I define a class as bellow
public class Items
{
    
    //--------------------definition of fields
    public int id;
    public String model;
    public String type;
    public String name;
    public String description;
    public String creator;
    public Date created;

    //----------------------definition of properties

    public void setId(int _id)
    {
        this.id = _id;
    }
    public int getId()
    {
        return id;
    }


    public void setModel(String _model)
    {
        this.model = _model;
    }
    public String getModel()
    {
        return model;
    }


    public void setType(String _type)
    {
        this.type = _type;
    }
    public String getType()
    {
        return type;
    }



    public void setName(String _name)
    {
        this.name = _name;
    }
    public String getName()
    {
        return name;
    }


    public void setDescription(String _description)
    {
        this.description = _description;
    }
    public String getDescription()
    {
        return description;
    }


    public void setCreataor(String _creator)
    {
        this.creator = _creator;
    }
    public String getCreator()
    {
        return creator;
    }


    public void setCreated(Date _created)
    {
        this.created = _created;
    }
    public Date getCreated()
    {
        return created;
    } 

    //-------------------------------Definition constructor

    public Items(int Id, String Model, String Type, String Name, String Description, String Creator, Date Created)
    {
       this.id = Id;
       this.model = Model;
       this.type = Type;
       this.name= Name;
       this.description = Description;
       this.creator = Creator;
       this.created = Created;
    } 


}


next, I have another class and in this class I define a method with argument
public class dataInteraction
{
   public static insert(int id, String model, String type, String name,
                               String description, String craetor, Date created )
    {       
       ArrayList arrayList = new ArrayList();
       arrayList.add(??????????????)
       
       
     }
}


my question is do I have to add argument or class?
arrayList.add(Items)


or
arrayList.add(id);
.
.
.
arrayList.add(created);

AnswerRe: ArrayList Pin
Cedric Moonen27-Sep-10 2:47
Cedric Moonen27-Sep-10 2:47 
GeneralRe: ArrayList Pin
future383927-Sep-10 3:25
future383927-Sep-10 3:25 
GeneralRe: ArrayList Pin
Cedric Moonen27-Sep-10 4:36
Cedric Moonen27-Sep-10 4:36 
GeneralRe: ArrayList Pin
Richard MacCutchan27-Sep-10 5:41
mveRichard MacCutchan27-Sep-10 5:41 
GeneralRe: ArrayList Pin
Cedric Moonen27-Sep-10 7:44
Cedric Moonen27-Sep-10 7:44 
GeneralRe: ArrayList Pin
Luc Pattyn27-Sep-10 8:44
sitebuilderLuc Pattyn27-Sep-10 8:44 
GeneralRe: ArrayList Pin
David Skelly27-Sep-10 22:47
David Skelly27-Sep-10 22:47 
GeneralRe: ArrayList Pin
Luc Pattyn28-Sep-10 2:14
sitebuilderLuc Pattyn28-Sep-10 2:14 
GeneralRe: ArrayList Pin
David Skelly28-Sep-10 3:16
David Skelly28-Sep-10 3:16 
GeneralRe: ArrayList Pin
Richard MacCutchan27-Sep-10 21:36
mveRichard MacCutchan27-Sep-10 21:36 
GeneralRe: ArrayList Pin
Nagy Vilmos28-Sep-10 1:45
professionalNagy Vilmos28-Sep-10 1:45 
GeneralRe: ArrayList Pin
Richard MacCutchan28-Sep-10 2:18
mveRichard MacCutchan28-Sep-10 2:18 
QuestionHow to implement normal Table control with GEF? Pin
sinron26-Sep-10 21:45
sinron26-Sep-10 21:45 
QuestionHow to refresh JTable of Frame one on close of Frame two Pin
Alok Sharma ji26-Sep-10 21:29
Alok Sharma ji26-Sep-10 21:29 
AnswerRe: How to refresh JTable of Frame one on close of Frame two Pin
David Skelly27-Sep-10 22:40
David Skelly27-Sep-10 22:40 
QuestionDefault form Pin
future383926-Sep-10 17:12
future383926-Sep-10 17:12 
AnswerRe: Default form Pin
David Skelly27-Sep-10 22:38
David Skelly27-Sep-10 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.