]سلام و خشته نباشید. من کد زیر رو نوشتم و با این ارور روبرو شدم : java.lang.IllegalArgumentException.
من تازه کارم و چیزی از ارور ها نمیدونم ممنون میشم اگه کمک کنید.
private static InputStream URLInput;
private static URL address;
private static URLConnection myconnection;
private static InputStream URLinfo;
private static int c;
public static void main(String[] args) {
try{
address = new URL("http:\\www.google.com");
/*
System.out.println("basic information :");
System.out.println("protocol : " + address.getProtocol());
System.out.println("port : " + address.getPort());
System.out.println("host : " + address.getHost());
System.out.println("default port : " + address.getDefaultPort());
System.out.println("path : " + address.getPath());*/
try{
/* show web content*/
myconnection = address.openConnection();
//check to see if there is content
int contentlength = myconnection.getContentLength();
if (contentlength != 0){
System.out.print("content(s): \n\n");
URLinfo = myconnection.getInputStream();
while( (c = URLinfo.read() ) !=-1 ){
System.out.print((char) c);
}
URLInput.close();
}else{
System.out.println("sorry! there is no content");
}
}catch(Exception e){
System.out.println(e.toString());
}
}catch(Exception ex){
System.out.println(ex.toString());
}