sorry if my question seems stupid, i'm just a newbee trying to learn java. In this code im just trying to calculate logarithm of 2 with recursive methode. But somehow eclipse tells me there are problems (the strong letters are the one which are red underlined, i tried to make those letter strong but only stars showed up instead).
Thanks and sorry for my English here. :D
import javax.swing.JOptionPane;
public class rekursivloga {
public static void main(String[] args) {
String einlesenzahl = JOptionPane.showInputDialog("Bitte eine Zahl eingeben!");
int zahl = Integer.parseInt(einlesenzahl);
int ergebnis = logrekursiv(zahl);
private int logrekursiv(int zahl) {
if (zahl == 1) {
return 0;
}
if (zahl <1 ) {
return -1;
}
if (zahl >1)
return 1 + logrekursiv (zahl/2);
}
}
}