InetAddress' methodes dont work ..
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   evrim_turgay
Posted On:   Tuesday, August 13, 2002 11:52 PM

import java.net.*; public class InetAddress { public static void main (String args[]) { try { InetAddress[] addresses = InetAddress.getAllByName ("www.yahoo.com"); for (int i = 0; i < addresses.length; i++) { System.out.println(addresses[i]); } } catch (UnknownHostException e) { System.out.println("Could not find"); } } } ****this code has runtime error*************************** servletjsp/InetAddress.java [9] cannot resolve symbol symbol : method getAllByName (java.lang.String)    More>>

import java.net.*;



public class InetAddress {



public static void main (String args[]) {



try {

InetAddress[] addresses = InetAddress.getAllByName

("www.yahoo.com");

for (int i = 0; i < addresses.length; i++) {

System.out.println(addresses[i]);

}

}

catch (UnknownHostException e) {

System.out.println("Could not find");

}

}

}

****this code has runtime error***************************



servletjsp/InetAddress.java [9] cannot resolve symbol

symbol : method getAllByName (java.lang.String)

location: class InetAddress

InetAddress[] addresses = InetAddress.getAllByName("www.yahoo.com");

-------------------------------------^----------------------------
1 error

Errors compiling InetAddress.


***********************************************************    <<Less

Re: InetAddress' methodes dont work ..

Posted By:   Anonymous  
Posted On:   Wednesday, August 14, 2002 12:33 AM

You are creating a class also called InetAddress:


public class InetAddress {

...




Try to change you class name to other and things work
fine.



PS: If on your working folder has a file called "InetAddress.java", try to rename (or remove it).
About | Sitemap | Contact