קטע קוד לא רץ (java)
import java.io.*; public class Targil1 { public static void main(String[] args) throws IOException { FileInputStream fin=new FileInputStream("c:\\input.txt"); DataInputStream din=new DataInputStream(fin); char b; for(int i=0;i<10;i++) { b=din.readChar(); System.out.println(b); } } } כל מה שהקטע אמור לעשות הוא ליקרא 10 תווים ראשונים מתוך c:\input.txt ולהדפיס אותם על המסך, במקום זה הוא מדפיס לי 10 סימני שאלה על המסך... מישהו יכול לעזור לי ולהגיד לי למה? תודה רבה לכולם!
import java.io.*; public class Targil1 { public static void main(String[] args) throws IOException { FileInputStream fin=new FileInputStream("c:\\input.txt"); DataInputStream din=new DataInputStream(fin); char b; for(int i=0;i<10;i++) { b=din.readChar(); System.out.println(b); } } } כל מה שהקטע אמור לעשות הוא ליקרא 10 תווים ראשונים מתוך c:\input.txt ולהדפיס אותם על המסך, במקום זה הוא מדפיס לי 10 סימני שאלה על המסך... מישהו יכול לעזור לי ולהגיד לי למה? תודה רבה לכולם!