Why Wont My Java Scanner Take In input?

前端 未结 3 798
南方客
南方客 2021-01-23 05:52
package Lessons;

import java.util.Scanner;

public class Math {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        System.         


        
3条回答
  •  甜味超标
    2021-01-23 06:03

    Try this for the section of taking a String input.

    `System.out.print(" Now enter ur operator ");
        String b1 =s.next();
        if (b1.equalsIgnoreCase("-")) {
            System.out.println("You chose " + b1 + "as ur operator");
    }`
    

提交回复
热议问题