JAVA Socket Communications

hi there

anybody knows anything about using JAVA Socket API's i am having some problems .

i want to communicate with the yahoo but it returns exceptions

can anybody hellp

^ Post code. What exactly are you doing and what exactly is the exception?



import java.util.Scanner;

import static java.lang.System.out;

public class Client {

public static void main(String[] args) {

String url="";

int port=80;

Scanner scan=new Scanner(;

// Socket s;



//out.println("Please Enter the URL");


Socket s=new Socket(url,port);


InputStream inputStream=s.getInputStream();

InputStreamReader isr=new InputStreamReader(inputStream);

BufferedReader in =new BufferedReader(isr);

OutputStream outputStream=s.getOutputStream();

OutputStreamWriter osr=new OutputStreamWriter(outputStream);

PrintWriter out=new PrintWriter(osr);

out.println("You Entered: "+url);





catch(Exception e){e.printStackTrace();}



oh sorry it working ok now

but the problem is that i want to display the HTML on the console but it displays only the following thing

Not Found

any suggestions want to display HTML........ on...... "Console"???!!??!! :/

yup thats the problemo

i mean i donot want to render the HTML just text should be displayed