I am trying to assign a method to a varibale called from a constructor, but it returns null when I am calling it.
public class ProjectManager {
Calculation a = new Calculation();
private Scanner in = new Scanner(System.in);
private Scanner price = new Scanner(System.in);
private Scanner duration = new Scanner(System.in);
private String input;
private Calendar calendar = new GregorianCalendar();
private SimpleDateFormat sdf = new SimpleDateFormat("dd-MMMMM-yyyy");
private String printCal = sdf.format(calendar.getTime());
private AdvertisementType ad = new AdvertisementType("webAdvert", "email", "radio");
private AdvertisementType[] array = new AdvertisementType[1];
double aa = a.getTotalPromotion();
When i try to print out "aa varibale" it gives me null value, but when I just do System.out.println(a.getTotalPromotion); the value isnt null. Is there any way to pass this method to variable and then call it.
Thank you in advance