I think it's to do with my sum but haven't been able to fathom it out.
Much appreciated :)
package com.codegym.task.task05.task0529;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Console-based piggy bank
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader myBufferedReader = new BufferedReader(new InputStreamReader(System.in));
int total = 0;
String b = "sum";
String s = myBufferedReader.readLine();
while (s != b) {
int a = Integer.parseInt(s);
total = a + total;
if (myBufferedReader.readLine().equals("sum")){
System.out.println(total);
break;
}
}
}
}