Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

2 Visitor Messages

  1. program for client: its showing an errorn compiling with "javac clientchat.java" it shows error
    error:25:cannot find symbol
    BuffferedReader br= new BufferedReader(new InputStreamReader(System.in));
    symbol=class BufferedReader
    location:class clientchat



    import java.net.*;
    import java.io.*;
    public class myclient
    {
    Socket s;
    DataInputStream din;
    DataOutputStream dout;
    myclient()
    {
    try
    {
    s=new Socket("Localhost",13);
    System.out.println(s);
    din=new DataInputStream(s.getInputStream());
    dout=new DataOutputStream(s.getOutputStream());
    clientchat();
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    public void clientchat() throws IOException
    {
    BuffferedReader br= new BufferedReader(new InputStreamReader(System.in));
    String s1;
    do
    {
    s1=br.readLine();
    dout.writeUTF(s1);
    dout.flush();
    System.out.println("Server message"+din.readUTF());
    }
    while(!s1.equals("stop"));
    }
    public static void main(String...g)
    {
    new myclient();
    }
    }




    program for server:
    import java.net.*;
    import java.io.*;
    class daytime
    {
    public static void main(String[]args)
    {
    try
    {
    Socket daytime=new Socket("192.168.1.7",13);
    System.out.println("Connetion established");
    daytime.setSoTimeout(2000);
    BufferedReader reader= new BufferedReader(new InputStreamReader(daytime.getInputStream()));
    System.out.println("result:"+reader.readLine());
    daytime.close();
    }
    catch (Exception e)
    {
    System.err.println("error:"+e);
    }
    }
    this server program is compiling correctly
  2. program for client: its showing an errorn compiling with "javac clientchat.java" it shows error
    error:25:cannot find symbol
    BuffferedReader br= new BufferedReader(new InputStreamReader(System.in));
    symbol=class BufferedReader
    location:class clientchat



    import java.net.*;
    import java.io.*;
    public class myclient
    {
    Socket s;
    DataInputStream din;
    DataOutputStream dout;
    myclient()
    {
    try
    {
    s=new Socket("Localhost",13);
    System.out.println(s);
    din=new DataInputStream(s.getInputStream());
    dout=new DataOutputStream(s.getOutputStream());
    clientchat();
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    }
    public void clientchat() throws IOException
    {
    BuffferedReader br= new BufferedReader(new InputStreamReader(System.in));
    String s1;
    do
    {
    s1=br.readLine();
    dout.writeUTF(s1);
    dout.flush();
    System.out.println("Server message"+din.readUTF());
    }
    while(!s1.equals("stop"));
    }
    public static void main(String...g)
    {
    new myclient();
    }
    }
Showing Visitor Messages 1 to 2 of 2
About nidhi goyal

Basic Information

About nidhi goyal
Java Skill Level:
Beginner

Statistics


Total Posts
Total Posts
1
Posts Per Day
0.00
Visitor Messages
Total Messages
2
Most Recent Message
May 1st, 2013 11:25 AM
Total Thanks
Total Thanks
0
  • Thanked 0 Times in 0 Posts
General Information
Last Activity
May 4th, 2013 11:13 PM
Join Date
April 30th, 2013