I tried several different methods to build the sum but cannot get the grasp of fixing it. What am I doing wrong?
de/codegym/task/task04/task0442/Solution.java:23: error: cannot find symbol
System.out.println(z2);
^
symbol: variable z2
location: class de.codegym.task.task04.task0442.Solution
package de.codegym.task.task04.task0442;
/*
Addieren
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
while (true){
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int z1 = Integer.parseInt(in.readLine());
if (z1 == -1){
break;
}
else if(z1 != -1){
int z2 =+ z1;
System.out.println(z2);
}
}
}
}