-5
Student
s에 대한 입력 파일을 검색하고 싶습니다. 지금까지 내 작품의 개요가 있습니다. 세터, 게터 및 표시 방법 (인쇄)와 학생을 파일로 검색
Class Student
Class StudentFile
import java.io.*;
import java.util.ArrayList;
public class StudentFile {
public void Trouver(int id)
{
try
{
File file = new File("C:/Users/Akram/Documents/akram.txt");
BufferedReader read = new BufferedReader(new FileReader(file));
String str;
while((str=read.readLine())!=null)
{
Student s;
if(s.getId()==id)
System.out.println(s.print());
}
read.close();
}
catch(IOException e) { System.out.println(e); }
}
}
이 방법 디스플레이 아무것도, 나는 이유를 모르겠어요. 통찰력있어?
입력 파일의 모양은 무엇입니까 ?? –
이 코드는 컴파일되지 않습니다. –
최소한의 예를 만들면 도와 드리겠습니다. [최소한의 완전하고 검증 가능한 예제를 만드는 방법] (http://stackoverflow.com/help/mcve)를 참조하십시오. – DavidPostill