Kako implementirati
Kako implementirati sledeci kod
import java.io.*;
public class Fajl {
private static String readLine(String imeFajla, int brLinije) {
String line="";
try {
BufferedReader fajl = new BufferedReader(new FileReader(imeFajla));
for (int i=1; i<brLinije; i++)
fajl.readLine();
line=fajl.readLine();
} catch (IOException ioe) {
ioe.printStackTrace();
}
return line;
}
public static void main(String[] varg) {
int brLinije=3;
String line=readLine("fajl.txt",brLinije);
System.out.println("Procitana je linija "+brLinije+": "+line);
}
}
u klasi compiler.java. Dati kod ispisuje liniju u kojoj je nadjena greska.
---------------------------------
Yahoo! DSL Something to write home about. Just $16.99/mo. or less
import java.io.*;
public class Fajl {
private static String readLine(String imeFajla, int brLinije) {
String line="";
try {
BufferedReader fajl = new BufferedReader(new FileReader(imeFajla));
for (int i=1; i<brLinije; i++)
fajl.readLine();
line=fajl.readLine();
} catch (IOException ioe) {
ioe.printStackTrace();
}
return line;
}
public static void main(String[] varg) {
int brLinije=3;
String line=readLine("fajl.txt",brLinije);
System.out.println("Procitana je linija "+brLinije+": "+line);
}
}
u klasi compiler.java. Dati kod ispisuje liniju u kojoj je nadjena greska.
---------------------------------
Yahoo! DSL Something to write home about. Just $16.99/mo. or less
- Follow-Ups:
- Re: Kako implementirati
- From: Sasa Ninkovic <sninkovic@gmail.com>
- Re: Kako implementirati
- References:
- Re: Hm, neverovatno ali istinito... problem sa INTEGERom!!!
- From: "Sasa" <gavra20@tesla.rcub.bg.ac.yu>
- Re: Hm, neverovatno ali istinito... problem sa INTEGERom!!!
Previous by date: Re: Hm, neverovatno ali istinito... problem sa INTEGERom!!!
Next by date: Re: VELIKI PROBLEM SA DATUMOM!!!
Previous by thread: Re[2]: test Next by thread: Re: Kako implementirati
Previous by thread: Re[2]: test Next by thread: Re: Kako implementirati