CrazyEngineers
  • Java programmer and Grid computing people

    sanamalik

    Member

    Updated: Oct 14, 2024
    Views: 860
    Hi All
    i am a student and new to programming and grid computing. i want to discuss my problems related to the fields with experienced people. anyone related to the fields please respond to my thread. your cooperation will be a grate help to me.

    thanx in advance
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • HImanshu_Sharma

    MemberMar 26, 2010

    hey i'm not a gud experienced person but i can sort out some of your prob as i can...so tell....?
    Are you sure? This action cannot be undone.
    Cancel
  • sanamalik

    MemberMar 28, 2010

    hey thanx for contacting me. actually i am doing a project for which i need your help to do some tasks. now i want to write the output of the program in a seperate file for which i added the following code
    FileOutputStream out; ​
    // declare a file output object

    PrintStream p; ​
    // declare a print stream object


    try

    {
    // Create a new file output stream

    // connected to "myfile.txt"

    out = ​
    new FileOutputStream("myfile.txt");

    // Connect print stream to the output stream

    p = ​
    new PrintStream( out );

    p.println (
    "This is written to a file");

    p.close();
    }
    catch (Exception e)
    {
    System.
    err.println ("Error writing to file");
    }

    }
    catch (Exception e)
    {
    e.printStackTrace();
    System.
    out.println("Unwanted errors happen");
    }
    }
    but it just prints " this is written to a file".
    i want to write the whole result that apperas in console.
    please suggest me the way to do so.

    one thing more, if u don't mind, can i have ur e-mail ID so that i can contact u there?

    regards.

    Are you sure? This action cannot be undone.
    Cancel
  • sanamalik

    MemberMar 28, 2010

    hey thanx for contacting me. actually i am doing a project for which i need your help to do some tasks. now i want to write the output of the program in a seperate file for which i added the following code

    FileOutputStream out; ​
    // declare a file output object


    PrintStream p; ​
    // declare a print stream object



    try


    {
    // Create a new file output stream


    // connected to "myfile.txt"


    out = ​
    new FileOutputStream("myfile.txt");

    // Connect print stream to the output stream


    p = ​
    new PrintStream( out );

    p.println (
    "This is written to a file");

    p.close();
    }
    catch (Exception e)
    {
    System.
    err.println ("Error writing to file");
    }

    }
    catch (Exception e)
    {
    e.printStackTrace();
    System.
    out.println("Unwanted errors happen");
    }
    }
    but it just prints " this is written to a file".
    i want to write the whole result that apperas in console.
    please suggest me the way to do so.

    one thing more, if u don't mind, can i have ur e-mail ID so that i can contact u there?

    regards.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register