Tag: JAVA.UTIL.SCANNER
public class Testing { public static void main(String[] args) { String test = “test”; Scanner type = new Scanner(System.in); String theTest = type.next(); switch(theTest) { case “test”: int input = type.nextInt(); System.out.println(“OK”); } } } public class TestingB { private int finalInput; finalInput = input; // Quiero asignarle a finalInput . . . Read more
Dice “error: tipos de operandos no válidos para el operador binario ‘||’” if(a.equals(“skels” || “iceS” || “fireS” || “elecS” || “healS”)) { card1 = 1; }
Estoy tratando de crear un servicio que analice cada línea de un archivo CSV y ejecute una variedad de booleanos para la cadena en cada línea. Todo está funcionando correctamente, pero la forma en que lo tengo configurado es que el usuario copia el texto del archivo CSV y lo . . . Read more
Entonces, hice una clase “burger” con un método para agregar cosas extra. Mi pregunta es ¿cómo puedo usar los casos 0, 1 y 2 solamente una vez? Por ejemplo, si uso el caso 0, ya no lo puedo usar más, solo puedo usar los casos 1 y 2. Si uso . . . Read more
Necesito verificar cada carácter en el archivo y convertirlo en byte. Pero desafortunadamente, el escáner no ofrece ninguna posibilidad de no separar el último carácter de la línea… Intento hacer algo como esto: public static byte[] readFile(String path) throws FileNotFoundException { Scanner in = new Scanner(new File(path)); List<byte> byteList = . . . Read more