System.out.println method

hi, i am new to java. plz help...thx
i would to do the following task.
i would like to print "hello world" every 1 second, such that:
while(true){
System.out.println("hello world\n");
--> wait for one second;
how to write the "wait for one second coding"?
thx all , and urgent...

You can use Thread.sleep(1000) to wait.
However, Thread.sleep(1000) cannot wait exact 1 sec.
while (true) {
System.out.println("...");
try {
Thread.sleep(1000);
catch (Exception ex) {}
And you don't need to use '\n' because println() prints always '\n'.

Similar Messages

  • System.out.println() in JUnit

    Hi Everybody,
    Can you please solve my confusion, weather System.out.println(); will work in JUnit or not.
    When I wrote System.out.println in Junit i am not getting anything.
    Thanks in advance
    Ananda

    Junit is also a java class which extends the junit.framework.TestCase.
    So the System.out.println() method always works in the junit class.
    Try this code:
    import junit.framework.TestCase;
    public class TestJUnitTest extends TestCase {
         public void testCase1() {
              System.out.println("hello");
              assertEquals(true, true);
    }

  • How to replace System.out.println() using templates

    can you give the complete code for my problem which is given below.
    package include;
    public class P
    public static cout(int a)
    System.out.println( a);
    public static cout(int a,int b)
    System.out.println(a + b);
    // like this i need to write to accept parameters from the class. which is importing this package
    for some more examples
    public static cout(int a,String s)
    System.out.printn(a +s);
    and many more type i.e. all types of arrangements of datatypes
    the above is the package called "include" Now Iam Importing the package in the class Hello:
    import include.P;
    public class Hello
    public static void main(String args[])
    int i=10;
    float f=12.23;
    String s="hello";
    P.cout(i,f); //cout is the static method of package(include) class " P"
    P.cout("welcome",s)
    // like this I want to send any type and any no of arguments as the System.out.println()
    will handle.
    My aim is to replace the System.out.println() with P.cout() which can be achieve in my idea by calling the static method ( such as cout() ) which internally use System.out.println() method. I am facing problem in achieving this because we donot know which type and how many parameters he will send .
    My task is we have to create a method which will accept any no.of arguments and is of any type.I think this can be done BY USING TEMPLATES.
    So please understand my problem and send me reply.I am waiting for your reply.
    thank you.

    Although I am not sure why you are doing this, if you really are trying to code a replacement for System.out.println then:
    out is a PrintStream and the println methods of PrintStream have the following signatures:
    void println()
    Terminate the current line by writing the line separator string.
    void println(boolean x)
    Print a boolean and then terminate the line.
    void println(char x)
    Print a character and then terminate the line.
    void println(char[] x)
    Print an array of characters and then terminate the line.
    void println(double x)
    Print a double and then terminate the line.
    void println(float x)
    Print a float and then terminate the line.
    void println(int x)
    Print an integer and then terminate the line.
    void println(long x)
    Print a long and then terminate the line.
    void println(Object x)
    Print an Object and then terminate the line.
    void println(String x)
    Print a String and then terminate
    So you should only need to create corresponding methods.

  • Why doesn't System.out.println work for Palm?

    In my Java code,
    how come I don't see any output on my screen (Palm Vx) when I try this?
    System.out.println("Hello World");
    Where is the output really going to???

    Hi,
    On POSE (Palm OS emulator), the System.out.println() method output is a file called STDOUT.txt, filed in some directory of the emulator.
    On the eal device, I think theres no output for system.out.println().
    Ricardo

  • Which toString() method does System.out.println() call?

    Which toString() method does System.out.println() call? I know that if I did something like System.out.println( new myClass() ) that the toString being called would be that of the myClass class.
    My initial thought about this was that System.out.println() is the equivalent of System.out.println( new Object() ) but I remember trying that in a test program and it gave me a myClass@some_hash_code type of message when adding the new Object() part within the System.out.println().
    Could someone please tell me which toString the System.out.println() statement calls? Also, it would be great if an elaboration follows :).
    Any input woudl be greatly appreciated!
    Thanks in advance!

    s3a wrote:
    My initial thought about this was that System.out.println() is the equivalent of System.out.println( new Object() ) Huh?
    In one method call you pass no parameters in the other method call you pass one parameter. How could you possibly think that they would do the same thing?
    Could someone please tell me which toString the System.out.println() statement calls? Also, it would be great if an elaboration follows :).Yes. The toString of the class of the object which you pass to the method. If that class does not have a toString method it uses the toString method it inherits from the parent class. If the parent class does not have a toString method it uses the one inherited and so and so on all the way up to the Object class.

  • Functionality of System.out.println()

    Hello,
    can some one please explain me what happens
    an System.out.println(); is called
    for example when we are pass an Object reference of some class
    it prints the address
    what functionality is taking place internally.
    which methods are called.

    You can look for yourself. The source code for the classes in the core API is in src.zip in the JDK download.

  • System.out.println not showing up in the console

    Hi,
    I've some System.out.println statements in a static block in a Stateless
    Session Bean. I could not see these outputs in the Weblogic console. I'm
    using Weblogic 5.1 Any one faced this problem before? any help is
    appreciated.
    Thanks & Regards,
    Nithi.

    Take a look in the weblogic log files they might be redirecting std out.
    "Ryan LeCompte" <[email protected]> wrote:
    >
    Hello Nithi,
    I'm all out of ideas, unfortunately! However, check out the following
    links for
    some possible insight into the problem:
    http://groups.google.com/groups?q=System.out.println+5.1+WebLogic&start=60&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3d3df18e%40newsgroups.bea.com&rnum=69
    http://groups.google.com/groups?q=System.out.println+5.1+WebLogic&start=70&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3977417b%40newsgroups.bea.com&rnum=71
    http://groups.google.com/groups?q=System.out.println+5.1+WebLogic&start=200&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=3bc20346%241%40newsgroups.bea.com&rnum=209
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Nithi Rajan" <[email protected]> wrote:
    Hi Ryan,
    Thanks for your reply and sorry for the long silence. I was on vocation.
    Thre problem still remains.I'm very sure that the EJB
    is deployed by WebLogic as I'm able to call some methods.
    and I'm also calling EJB methods from Servlet. But my
    System.out.println statments work fine in the Servlet and
    not inside EJB (or anyother classes used by EJB).
    Any one has faced similar problems? BTW am using WebLogic 5.1
    Thanks in advance,
    Regards,
    Nithi.
    "Ryan LeCompte" <[email protected]> wrote in message
    news:[email protected]...
    Hello Nithi,
    I find it strange that your System.out.println statements are beingexecuted from
    within your servlets, but not in your stateless session bean. Are
    you
    positive
    that your EJB is being located and deployed by WebLogic? The statementsin
    your
    static { } block should be executed as soon as the WebLogic class
    loader
    finds
    the class and loads it into the JVM. I would suggest examining theconsole
    and
    try to determine if your EJB is in fact being deployed. Are you invokingmethods
    on the EJB inside of your servlets? Are you using any logging frameworkfrom within
    the EJBs which would redirect output to a file?
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Nithi Rajan" <[email protected]> wrote:
    Hi Ryan,
    Thanks for your reply. The setting in the weblogic.properties is
    as
    follows.
    weblogic.system.enableConsole=true
    So, that tells me that I should see all the System.out.printlns right?
    (Pleasecorrect me if I'm wrong). I can see all the System.out.println
    from
    my
    servletand not from the Session Bean (even if the System.out.println
    is
    outside
    static block).
    Please let me know your thoughts.
    Thanks & Regards,
    Nithi.
    "Ryan LeCompte" <[email protected]> wrote in message
    news:[email protected]...
    Hello Nithi,
    Are you sure that you don't have WebLogic configured to redirect
    all
    messages
    to a file instead of the console? Are you able to see yourSystem.out.println
    statements when placed within other methods of your stateless sessionbean? Please
    be a bit more specific.
    Thank you,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Nithi Rajan" <[email protected]> wrote:
    Hi,
    I've some System.out.println statements in a static block in a
    Stateless
    Session Bean. I could not see these outputs in the Weblogic console.
    I'm
    using Weblogic 5.1 Any one faced this problem before? any helpis
    appreciated.
    Thanks & Regards,
    Nithi.

  • Strange behavior with System.out.println

    I was working with the following code:
    1. public class DemoChar {
    2. public static void main(String args[]) {
    3.
    4. char buf[] = new char[50];
    5. buf[0] = 'a';
    6. buf[1] = 'b';
    7. buf[2] = 'c';
    8. buf[3] = 'd';
    9. buf[4] = 'e';
    10. System.out.println( buf);
    11. }
    12. }
    if you print "buf", it really works; however if you change line 10 by :
    System.out.println("--->" + buf );
    The method "println()" doesn't write "--->abcde". The functionality doesn't the same. It will appear "----> [C@3e25a5"
    Could you help me?
    I don't understand that behavior. I am using "java version 1.6.0_07"

    buf's an array and thus is an object. object's don't inherently know how to represent themselves as Strings, so you have to do other things to make sure that they print out ok. To get a char array to print well, you could use the String method valueOf(...):
    public class DemoChar
      public static void main(String args[])
        char buf[] = {'a', 'b', 'c', 'd', 'e'};
        System.out.println(buf);  // this seems to call implicitly String.valueOf(buf)
        System.out.println("--->" + buf);  // this however seems to call buf.toString() with different results
        System.out.println("--->" + String.valueOf(buf));
    }Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you can will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag &#91;code] at the top of your block of code and the tag &#91;/code] at the bottom, like so:
    &#91;code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    &#91;/code]or
    {&#99;ode}
      // your code block goes here.
      // note here that the tags are the same.
    {&#99;ode}Edited by: Encephalopathic on Aug 21, 2008 9:40 AM

  • Using System.out.println() in Scrapbook

    I am working through some tutorials on formatting numbers:
    http://docs.oracle.com/javase/tutorial/java/data/numberformat.html
    I am trying to use scrapbook. I can't seem to get the result I am wanting from System.out.println("Hello world")...I get null. To be specific I am trying to inspect:
    int i = 461012;
    System.out.format("The value of i is: %d%n", i)In this case I get:
    java.io.PrintStream@46b372
    Something tells me that System.out.format can't work in a scrapbook. Is there a way without writing a main and running as java?

    It seems that the format method returns the PrintStream (allowing you to chain method calls), and the return value is being printed.
    You would get the output you're looking for, if you use the String.format() method, since that'll return the formatted String.

  • System.out.println in EJB

    Hi I have given System.out.println in my EJB object. But I am not able to see the output in my console. But when I give printStackTrace in my JSP(from where I can EJB)....it is displaying the exception....
    So my question is Can we give System.out... in EJB?. Should we set any property to see the output of System.out...in the console?.

    Here is my code
    From UserManager I call the EJB
    public boolean validateSignOn(String strUserName,String strPassword) throws ProdSchedException{
    try{
    UserMgrHome home = (UserMgrHome)getEJBHome("UserMgr",UserMgrHome.class);
    UserMgr userMgr = home.create();
    return userMgr.validateSignOn(strUserName,strPassword);
    catch(RemoteException rex){
    ServerLog.log(rex.getMessage(),ServerLog.ERROR);
    throw new ProdSchedException(rex,"Server Failed");
    catch(CreateException cex){
    ServerLog.log(cex.getMessage(),ServerLog.ERROR);
    throw new ProdSchedException(cex,"Create Exception");
    This is my EJB code
    import javax.ejb.*;
    import java.rmi.RemoteException;
    import java.util.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.w3c.dom.*;
    import java.io.*;
    * User Manager Session Bean
    public class UserMgrEJB implements SessionBean {
    SessionContext cntx;
    public boolean validateSignOn(String strUserName,String strPassword) throws ProdSchedException{     
    UserDAO dao = new UserDAO();
         System.out.println("Inside EJB");
    boolean bValidUser = dao.validateUser(strUserName,strPassword);
    if(!bValidUser){
    throw new ProdSchedException("Invalid User");
    return bValidUser;
    //Bean methods
    public void ejbCreate(){
         System.out.println("Inside EJB Create");
    public void ejbRemove(){
    public void ejbActivate(){
         System.out.println("Inside EJB Activate");
    public void ejbPassivate(){
    public void setSessionContext(SessionContext cntx){
    this.cntx = cntx;
    This is mu UserDAO code
    public class UserDAO extends DAO{
    public boolean validateUser(String userName,String password) throws ProdSchedException{
    Connection conn = null;
    PreparedStatement stmt = null;
    ResultSet result = null;
         System.out.println("Inside validateUser in DAO");
    try{
              boolean bIsValidUser = true;
         String selectStatement = "SELECT SYSDATE from DUAL";
         conn = getConnection();
    stmt = conn.prepareStatement(selectStatement);
    result = stmt.executeQuery();
    while(result.next()){
    bIsValidUser = true;
    return bIsValidUser;
    catch(SQLException sqex){
    ServerLog.log(sqex.getMessage(),ServerLog.ERROR);
    throw new ProdSchedException(sqex,sqex.getMessage());
         finally{
    try{
    close(conn,stmt,result);
    catch(ProdSchedException slex){
                   ServerLog.log(slex.getMessage(),ServerLog.ERROR);
    throw slex;
    } // end class
    And the error I get in the console is this(since I have given printStackTrace in my JSP)
    ProdSchedException: SQL Error
    at UserDAO.validateUser(UserDAO.java:
    44)
    at UserMgrEJB.validateSignOn(
    UserMgrEJB.java:26)
    at UserMgrEJB_p3hctp_EOImpl.v
    alidateSignOn(UserMgrEJB_p3hctp_EOImpl.java:46)
    at UserManager.validateSignOn(User
    Manager.java:20)
    at jsp_servlet._public.__login._jspService(__login.java:123)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1094)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:437)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:319)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:5626)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:685)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3213)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2555)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:251)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:219)

  • System.out.println and Network Adapter problem

    Hello,
    I am encountering a 2 strange problems. I have 2 oracle application server instances, one dev and one production.
    The first problem is when I type System.out.println in the JSP's i am able to see the output in both \opmn\logs\oc4jinstance. But the System.out.println in the java classes or bean show up only in development logs but not in production box.
    Is there a setting I am missing here?
    The second problem is on our development machine the application works fine, but as soon as we deploy the application on production I encounter:
    could not open new connection: Io exception: The Network Adapter could not establish the connection
    I have a class called DBUtils, which uses a 3rd party library to get connections from the connection pool as below. Using JSP I call the getConnection(). On my dev Oracle Application Server Instance it works fine, but on production I get the error. Can it be there is a setting that I am missing on the production box?
    When I use a JSP and connect to the database without using the DBUtil class. I can connect to the database fine. Also using the DBUtil class with production oracle IP address on the development machine lets me connect with no problem, but production machine does not let me.
    public class DBUtils {
    static ConnectionPoolBean pool;
    static {
    System.out.println("DBUtils() - before connection pool bean");
    pool = new ConnectionPoolBean();
    pool.setDriverClassName("oracle.jdbc.driver.OracleDriver");
    pool.setdbURL("jdbc:oracle:thin:@IPADDRESS:PORT:SID");
    pool.setUser("USERNAME");
    pool.setPassword("PASSWORD");
    pool.setInitialConnections(1);
    pool.setIncrement(1);
    pool.setSoftMaxConnections(40);
    public static Connection getConnection() throws SQLException {
    System.out.println("Getting Oracle Connection");
    return pool.getConnection();
    public static void returnConnection(Connection conn) throws SQLException {
    System.out.println("Returning Connection");
    pool.returnConnection(conn);
    Thanks for your help in advance.

    Hi
    System.out.println is a method of PrintStream in IO which is used to print the output on console in java progs.Here in jsp ,the o/p is printed on server's console window.But out.println is totally different as, out is implicit object derived from JspWriter and is used sly to PrinWriter 's object is used in servlets.It's work is to write upon Browser.
    System.out.println() is normally used in jsp for debugging purposes only.
    Ashish

  • System.out.println() Ignored

    I have a open source JDBC driver which has to be enhanced.
    It is compiled with ant. I tried to code in my new methods for enhancing it and wanted to print the intermediate variables through System.out.println(). This particular line for printing onto the console is ignored and remaining code is working fine.
    Can someone tell me where I went wrong?

    Junnu wrote:
    Can someone tell me where I went wrong?You went wrong in assuming that line is "ignored." It's not. So one of the following must be true:
    1. That line is never reached because the code branch it's in is not executed.
    2. That line is never reached because an exception occurs.
    3. That line is being executed, but System.out has been redirected away from the console by System.setOut().
    4. That line is being executed, but System.out has been redirected away from the console by the command line, such as using > in linux.
    5. That line is being executed, but there's an error. Try System.out.checkError().
    6. That line is being executed, but System.out's buffer has not filled up so it's not appearing on the terminal. System.out.flush() would fix this, but this is not a likely scenario. I think that System.out is created with autoflushing enabled, but I may be mistaken.

  • System.out.println stalls my jdev

    Hello
    Is there a bug database with regards to JDeveloper 3.0?? My JDev seems to stall when I attempt to type out a "System.out.println(..)" statement. Has anyone encountered something similar?? WinNt4.0 workstation (sp5)
    Tia,
    -Robert-

    Same problem, NT 4.0. Often it stalls just when you type the open parenthesis prior to the string. My guess is it has something to do with the popup choices menu for that method. I don't know how to fix it but I'm using a clunky work-around by copying and pasting something like:
    System.out.println("");
    which includes the quotes inside the parentheses. That seems to keep the popup from trying to show up.

  • System.out.println(...) causes applet to throw OutOfMemoryError exception

    Hi all,
    I've created an applet with a very barebones method in it, that is causing an OutOfMemoryError when run for approx 2 minutes.
    Here is the code...
    import javax.swing.JApplet;
    public class BridgeMapApplet extends JApplet
    public void start()
              Thread t = new Thread(){
              public void run() {
                   String response = "<bridgeMapResponse><bridges><bridge><macAddress>00:07:D5:01:3B:ED</macAddress><parentMacAddress>00:00:00:00:00:00</parentMacAddress><ipAddress>192.168.254.157</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>0</rssi><stpStatus></stpStatus><children><bridge><macAddress>00:07:D5:01:3C:19</macAddress><parentMacAddress>00:07:D5:01:3B:ED</parentMacAddress><ipAddress>192.168.254.166</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>73</rssi><stpStatus></stpStatus><children><bridge><macAddress>00:07:D5:01:45:BE</macAddress><parentMacAddress>00:07:D5:01:3C:19</parentMacAddress><ipAddress>192.168.254.152</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>80</rssi><stpStatus></stpStatus><children><bridge><macAddress>00:07:D5:01:47:12</macAddress><parentMacAddress>00:07:D5:01:45:BE</parentMacAddress><ipAddress>192.168.254.153</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>0</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:46:78</macAddress><parentMacAddress>00:07:D5:01:45:BE</parentMacAddress><ipAddress>192.168.254.162</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>0</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:3D:B9</macAddress><parentMacAddress>00:07:D5:01:45:BE</parentMacAddress><ipAddress>192.168.254.154</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>0</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge></children><description></description><deviceStatus>New</deviceStatus></bridge></children><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:46:94</macAddress><parentMacAddress>00:07:D5:01:3B:ED</parentMacAddress><ipAddress>192.168.254.165</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>63</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:3D:D3</macAddress><parentMacAddress>00:07:D5:01:3B:ED</parentMacAddress>ipAddress>192.168.254.168</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>78</rssi><stpStatus></stpStatus><children><bridge><macAddress>00:07:D5:01:46:7A</macAddress><parentMacAddress>00:07:D5:01:3D:D3</parentMacAddress><ipAddress>192.168.254.163</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>100</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:3D:D5</macAddress><parentMacAddress>00:07:D5:01:3D:D3</parentMacAddress><ipAddress>192.168.254.161</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>99</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:3D:6F</macAddress><parentMacAddress>00:07:D5:01:3D:D3</parentMacAddress><ipAddress>192.168.254.164</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>100</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge><bridge><macAddress>00:07:D5:01:3D:81</macAddress><parentMacAddress>00:07:D5:01:3D:D3</parentMacAddress><ipAddress>192.168.254.167</ipAddress><card></card><secondCard></secondCard><wdsName></wdsName><cfgFileTag></cfgFileTag><rssi>100</rssi><stpStatus></stpStatus><description></description><deviceStatus>New</deviceStatus></bridge></children><description></description><deviceStatus>New</deviceStatus></bridge></children><description></description><deviceStatus>New</deviceStatus></bridge></bridges><lastUpdate>2009-12-21T19:45:25.375Z</lastUpdate></bridgeMapResponse>";
    while(true) {
                        System.out.println(response);
                        try{
                             Thread.sleep(10);
                        }catch(InterruptedException ie){}
                   } //end while
              } //end run
              }; //end thread
              t.start();
    } // end of start()
    } // end of applet
    When I connect to the process with a java debugger, i get the following output after a couple minutes...
    C:\eclipse\workspace\applet>jdb -attach 2502
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    Initializing jdb ...
    >
    Exception occurred: java.lang.OutOfMemoryError (uncaught)"thread=traceMsgQueueTh
    read", com.sun.deploy.util.Trace.firePrintlnEvent(), line=-1 bci=58
    traceMsgQueueThread[1]
    ===================================================================
    I know this is a very frequent thread execution, but this was to speed up the replication of a bug that occurs after a few hours.
    Regardless of how low the Thread.sleep() interval is, why would this cause an OutOfMemoryError?
    thank you!!

    When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the indentation and formatting of the sample. To use the code tags, select the sample and click the CODE button.
    As an aside, what on earth is the use of dumping output to the console in an applet?
    My initial thought as to how prevent the OOME when dumping loads to the Java Console is - don't dump loads to it. The Java Console is effectively useless to the average end-user, either way. The Java Console is not easy to open, for an applet that makes it through the init() successfully.

  • Why System.out.println not PrintStream.println ?

    Hi, just a beginner question
    I just wonder why should we use System.out.println, not PrintStream.println ?
    the field out in the System class is the instance of PrintStream class, isn't it?
    So why don't we just use the PrintStream class directly?
    Thanks..
    Edited by: riff_almighty on Oct 27, 2007 3:27 AM

    According to the api:
    A PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently. Two other features are provided as well. Unlike other output streams, a PrintStream never throws an IOException; instead, exceptional situations merely set an internal flag that can be tested via the checkError method. Optionally, a PrintStream can be created so as to flush automatically; this means that the flush method is automatically invoked after a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written.
    So there is nowhere mentioned about the PrintStream associated with the user console. System.out is the one instance of PrintStream which is associated with the console...
    Also println() is not a static method and cant be called upon the class...
    Edited by: VijayBabu on Oct 27, 2007 12:51 AM

Maybe you are looking for

  • Problem with panelbox and af:table scrollbar issue and panelstretchlayout

    Hi, <af:panelStretchLayout > <f:facet name="center"> <af:panelSplitter orientation="vertical" positionedFromEnd="true" inlineStyle="vertical-align:inherit;"> <f:facet name="first"> <af:subform default="false" id="xyz"> <af:panelBox background="light"

  • Out of memory?  Impossible!

    I used Adobe Image Ready to prepare a photo for e-mailing. When I attempted to use my sharpening filter (a third party filter called nik pro) I received an out of memory error message. That just cannot be possible! I am using a G5 (dual 2.3 GHz) with

  • Approval process not waiting for approval tasks to be completed

    Hi All, I created an Approval process for a resource. When a request is created for this resource an approval task is assigned to the manager of the user. Before the approval task is completed by the manager the resource is getting provisioned. Is th

  • How do i get rid of "incorrect password" notification ?

    My handy-dandy IPhone 4S constantly shows "incorrect password". annoying. i don't even WANT to have a password ! any help out there?

  • KeyUp Script Provided by Adobe Does Not Function. . .

    Hi There, I downloaded the KeyUp script provided by Adobe. The link to the script can be found in the help files for the Mac version of AE CS3. Essentially, the script is designed to allow users to change the shortcut key assignments in AE CS3. So, I