Java : Method return Issue <p>Hi there I have created a class to run another Test class but I am facing some problems. I have declared both the agePremium and ticketPremium as private doubles. I later on use them in 2 methods to calculate the premium respectively. But when it gets to the part where i want t use the calculated variables in another calculation here</p> <pre><code>/* public double premium() { if (ticket &lt;4){ return ((BASE_PREMIUM*value) * agePremium) * ticketPremium; } else { System.out.println("Sorry, you have too many tickets !!"); return 0; } } */ </code></pre> <p>it does not read the values from my methods and instead reads the 1 from the declaration and initialization.</p> <p>private double agePremium =1; private double ticketPremium =1;</p> <p>and it multiplies them.</p> <p>How do i get them to link them to each other and replace the 1 with the new values and multiply. Thanks</p> <pre><code>import java.util.Scanner; public class Driver { private int age; private int ticket; private double value; final double BASE_PREMIUM=0.05; private double agePremium =1; private double ticketPremium =1; Scanner scanner = new Scanner(System.in); public void read() { System.out.println("Driver’s Age?"); age = scanner.nextInt(); System.out.println("Number of Tickets?"); ticket = scanner.nextInt(); System.out.println("Value of Car?"); value = scanner.nextDouble(); } public double premium() { if (ticket &lt;4){ return ((BASE_PREMIUM*value)*agePremium)*ticketPremium; } else { System.out.println("Sorry, you have too many tickets !!"); return 0; } } public void premiumAge() { if (age &gt; 29) { agePremium += 0; } else if (age &lt;= 29 &amp;&amp; age &gt;= 25) { agePremium += 0.10; } else { agePremium += 0.15; } } public void premiumTicket() { switch (ticket) { case '1': ticketPremium += 0.1; break; case '2': ticketPremium += 0.25; break; case '3': ticketPremium += 0.50; break; case '0': ticketPremium += 0.00; default: ticketPremium = 0.00; break; } } } </code></pre>