Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to check it certain url exist?

807599Dec 19 2006 — edited Dec 20 2006
hi there....
can someone help me??
is it possible to check if certain url exist?

public class checkFile1{
public static void main (String [] args) {

String file = "http://www.yahoo.com";

if (file = exist){
open file;
}

else{
System.out.println("nv exist");
}

}
}

Message was edited by:
n_dilah
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2007
Added on Dec 19 2006
13 comments
850 views