On Jul 24, 7:53 pm, nguyen thanh lam <[email protected]> wrote:
> 1. I create a class Candidate with attributes : id , name. I want when
> i enter a new value, a variable is automatic created. How to do ?
> Ex :
>  when I enter "Peter" , a variable "namecandiate1" automactic created.
> I enter "Marry", avariable "namecandidate2" automatic created.
Dynamic generation of variable? I am not sure if that is even
possible.

In the meantime, you might want to consider other alternatives.
Another way, is to store the candidates in an array and access them
via their index.
>
> 2. i want "ID" variable isn't dublicate (ID is key).
>
> Please help me !
>
> Thanks.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to