Was mache ich hier falsch?
Tests mit Klein- / Großbuchstaben und Sonderzeichen wie .(/ waren erfolgreich...
Darf ich an dieser Stelle evtl. nicht byte mit int vergleichen?
package de.codegym.task.task18.task1816;
/*
ABC
*/
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Solution {
public static void main(String[] args) throws IOException {
FileInputStream fileInputStream = new FileInputStream(args[0]);//"Q:/Java/test.txt");
String alph = "abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXY";
byte[] abc = alph.getBytes();
int count = 0;
while (fileInputStream.available() > 0) {
int read = fileInputStream.read();
for (byte b : abc) {
if (read == b) {
count++;
break;
}
}
}
fileInputStream.close();
System.out.println(count);
}
}