An error occurs when creating: (9: 9) illegal start of expression.
Just learning, the first week. What's my mistake?
there is a code:
package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner scc = new Scanner(System.in); public static void main(String[] args) { int firstNum = whatnumber(); int secodNum = whatnumber(); char znak = Goperation(); int resault = resaultX(); System.out.print(resault); } public static int whatnumber() { System.out.print("Введите число: "); int num; num = scc.nextInt(); } public static void Goperation() { System.out.print("Введите знак: "); char znakL; znakL = scc.hasNext(); } public static void resaultX(int firstNum, int secondNum, char operation){ int resault; switch (operation) { case "+": resault = firstNum + secondNum; break; case "-": resault = firstNum - secondNum; break; case "/": resault = firstNum / secondNum; break; case "*": resault = firstNum * secondNum; break; } } }
mainone moremainand a bunch of other methods are crammed. - Sergey Gornostaevswitch, the incorrect return value of theGoperation, in general, is a lot. - Komdosh