I am quite new to java, I am trying to make a calculator. What i don't understand is in the last line of code says "The local variable answer may not have been initialized"? How do I initialize variable answer?
import java.util.Scanner; public class Basic_Calculator { public static void main (String args[]){ Scanner Bucky = new Scanner(System.in); double fnum, snum, answer = ; String symbol; System.out.println("Enter first number"); fnum = Bucky.nextDouble(); System.out.printf("what is you second number?"); snum = Bucky.nextDouble(); System.out.println("What will you do with these numbers?"); symbol = Bucky.next(); if (symbol == "*"){ answer = snum * fnum;} if(symbol == "/"){ answer = snum / fnum;} if (symbol == "+"){ answer = snum + fnum;} if (symbol == "-"){ answer = snum - fnum;} System.out.printf("Your answer is: "+ answer); } }