PRUBOWALEM WSZYSTKIEGO RZEBY SIE UDALO ALE WCIONSZ TEN SAM EFEKT
KOD
import java.net.*;
import java.io.*;
import java.util.*;
public class root {
public static void printinfo (URLConnection u) {
System.out.println (u.getURL ().toExternalForm () +" : ");
System.out.println ("Content Type: " + u.getContentType());
System.out.println ("ContentLength: " + u.getContentLength());
System.out.println ("Lastmodified: " + new Date (u.GetLastModifed());
// Czytamy i drukujemy pierwszych 5 linii w URL
System.out.println ("Pierwszych 5 linii " );
DataInputStream in = new DataInputStream (u.getInputStream());
for (int i = 0; i < 5; i++ ) {
String linia = in.readLine ();
if (linia == null ) break;
System.out.println (" " + linia );
} }
public static void main(String[] args) {
URL url = new URL (args [0] );
URLConnection polaczenie = url.openConnection();
printinfo (polaczenie);
} }
KOMPLIATOR
C:\Programme\Java\jdk1.6.0_21\bin>javac root.java
root.java:9: ')' expected
System.out.println ("Lastmodifed: " + new Date (u.getLastModified( ));
1 error
PROSZE O POMOC