Hello,
Following is my case.
i have main method in which i have a switch case.
i'm instantiating my objetcs in the main ;
public class BoiteALettres
{
public static void main(String[] args) throws IOException
{
ObjetPostal BoiteALettresListe[]= new ObjetPostal[2];
Colis c1=new Colis();
Lettre let1= new Lettre();
BoiteALettresListe[0]=c1;
BoiteALettresListe[1]=let1;
/* some instructions*/
switch (choix)
{
case "lettre":
infoSurLettre();
break;
case "colis":
infoSurColis();
break;
default:
System.out.println("Mauvaise choix ; Lettre ou Colis : ");
}
public static void infoSurLettre()
{
System.out.println("inside lettre "+ BoiteALettresListe[0].isLettrePrioritaire());
}
How to make visible the objets and its methods to my calling function infoSurLettre()
i have tried also to instantiate before the main methid and it does not work.
Any help