Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Greetings ,
How to instanciate the Gregorian calendar parametrs in my main method ?

I have this constructor :

Java
public Personne(String leNom,String lePrenom, GregorianCalendar laDate, Adresse lAdresse){
        nom = leNom.toUpperCase();
        prenom=lePrenom;
        dateNaissance=laDate;
        adresse=lAdresse;
        nb_instance ++; 
        }


So i want to test the object by instanciating it from main :
Java
public class test {
    public static void main(String [] args{

            Personne personne1 = new Personne("Voronitski,Viktor,1986,Calendar.FEBRUARY,25,"Slavinskogo");
        }

}



The compiler is saying that actual parametrs differs in lenght.
Posted
Comments
Sergey Alexandrovich Kryukov 27-Nov-14 12:49pm    
This is not a valid code, because "" are unbalanced.
Without it, we cannot count the number of your parameters in the call. But frankly, we don't have to do that. I think the ability to use brain and count to 4 is one of the prerequisites to asking questions at the forums. Count them accurately and match their types and semantic roles correctly.
—SA

1 solution

Personne personne1 = new Personne("Voronitski","Viktor",1986,Calendar.FEBRUARY,25,"Slavinskogo");
                                             ^ ^      ^ -------------------------


0) You're missing some quotes
1) You provide three parts of a date, not a date.
 
Share this answer
 
Comments
voronitski.net 27-Nov-14 14:25pm    
still doesn t want to accept the date format

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900