Hi, when I try to get the name and the host I recieve errors
which are commented in the code.
I don't know what is the problem...?
CODE
import java.net.URL;
import java.net.MalformedURLException;
import javax.swing.*;
public class Ispitna4
{
public static void main(String [] args)
{
try
{
String aaa= JOptionPane.showInputDialog("Enter an adress:");
URL adresa = new URL(aaa);
String a=adresa.getFile();
String b=adresa.getHost();
}
catch(MalformedURLException e)
{
System.out.println("Exception...");
}
System.out.println("File name: "+a); //cannot find symbol variable a
System.out.println("Host name: "+b); //cannot find symbol variable b
}
}
CODE
System.out.println("File name: "+a); //cannot find symbol variable a
System.out.println("Host name: "+b); //cannot find symbol variable b
This post has been edited by PennyBoki: 13 Feb, 2007 - 08:21 AM