ruski
08-09-2006, 12:22 AM
Hi,
Im just making a stupid java program to practise some regex because Im new to it and came across an annoying error with the URL declaration, here is the error:
ForumHacker.java:91: cannot find symbol
symbol : constructor URL(java.lang.Object)
location: class java.net.URL
URL u = new URL(LineList.get(1));
^
I was thinking this is because im declaring the URL a second time in the class file, but in different voids, as you can see here:
public static void FetchLinks(String directory)
{
int pnum = 1;
while(pnum < 5)
{
try {
URL url = new URL("linklinklinklink");
URLConnection con = url.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
//and so on
public static void getPicLinks()
{
try {
URL u = new URL(LineList.get(1));
URLConnection ucon = u.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(ucon.getInputStream()));
System.out.print(in.readLine());
} catch(Exception e) { System.out.print(e); }
}
Some help would be greatly appritiated
Thanks in advance
Im just making a stupid java program to practise some regex because Im new to it and came across an annoying error with the URL declaration, here is the error:
ForumHacker.java:91: cannot find symbol
symbol : constructor URL(java.lang.Object)
location: class java.net.URL
URL u = new URL(LineList.get(1));
^
I was thinking this is because im declaring the URL a second time in the class file, but in different voids, as you can see here:
public static void FetchLinks(String directory)
{
int pnum = 1;
while(pnum < 5)
{
try {
URL url = new URL("linklinklinklink");
URLConnection con = url.openConnection();
BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream()));
//and so on
public static void getPicLinks()
{
try {
URL u = new URL(LineList.get(1));
URLConnection ucon = u.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(ucon.getInputStream()));
System.out.print(in.readLine());
} catch(Exception e) { System.out.print(e); }
}
Some help would be greatly appritiated
Thanks in advance
