How to print to console with out using system.out.print

Hi All
Is it possible to print the text to console with our using System.out.println(). i done as follows but i does not worked
import java.io.*;
import java.util.*;
public class myclass
     public static void main(String[] args)
          BufferedWriter br = null;
          try {
               br = new BufferedWriter(new OutputStreamWriter(System.out));
               br.write("Myclass123",0,10);
          } catch (Exception io) {
               io.printStackTrace();
so it will be appretaible if any body helps me in solving this question

i am using sysstem.out to specify that out put
generated should be pumped to console inted of file.
i mean system.out will lead to the console. thats why
i used that. as Either I have no idea what you are talking about, or you have no idea what I am talking about when I refer to writing to File "con".
suystem.in means keyboard.Actually, it means "the system's standard input stream, wherever it may come from".

Similar Messages

  • I have an Ipad and about to buy a macpro. My husband has a PC with a printer attached. Can I use the same printer or do I need to buy my own?

    I have an Ipad and about to buy a Macpro.  My husband has a PC with XP operating system with a printer/scanner. Do I need to buy my own printer or can we both use the same printer?

    It depends. The Mac Pro may come with Lion, or at least 10.6.8, and some printers are no longer supported (Windows 7 either).
    Also, you have to download drivers, sometimes from vendor. Sometimes apple has some thru software update, but not always.
    without knowing printer make/model it is next to impossible to say for certain one way or another. If you do buy new printer, you can walk away with more power in injet, laser, and scanners to make it worthwhile. I had to update all of those when support was dropped. amazing how much faster and better the new models are, and for much less.
    Though I would focus on Mac Pro -
    Mac Performance Guide Reviews
    Apple Downloads
    RoaringApps Mac OS X Lion Application Compatibility
    Lion App Compatibility Table - RoaringApps

  • How to connect my ipad with mac using bluetooth?

    how to connect my ipad with mac using bluetooth?

    You can't so quit trying. Take a look at this to see what is supported with regard to Bluetooth connections in iOS.
    iOS: Supported Bluetooth profiles

  • Multiple Threads Using System.out.println...

    i have a client server app and each client that connects to the server has its own thread.
    i am running the server on a pc using windows xp and to run it i just use a bat file which uses cmd.exe and my output using System.out.println prints out in the cmd.exe.
    each of my threads is using System.out.println to send debug info and outs quite often.
    after the screen fills a scroll bar appears at the right and you can scroll back to see past output.
    my app is all running ok but when i had a ton of output coming in all at once i tried to scroll back to see the older output and realized that if i click down on the scroll bar and fight the new input it freezes my server app. then when i release it it continues lol.
    it made me wonder if output from multiple threads when there are many all at once (say 20 or 30 threads all outputing at the exact same time) could cause a slow down or effect the performance of the server?
    i use a debug variable so i can just turn this output 100 % off except for critical errors so there would be no output but i am just curious as to whether or not it may be causing problems when its on.

    That's not a performance issue, I guess System.out.println() simply gets blocked by the console while you're scrolling and thus your app stalls, until you stop doing that.
    Maybe you should look into logging.

  • Compile error when using System.out

    Hello,
    I have a static part (declarative, comes within <%! %>) inside a jsp. When i use System.out.println inside this, it throws me error. Let me know what is the reason for the same.
    Thanks, Aravinth

    Hi Aravinth.
    You it self told that <%! %> is a declarative statement then how you can give a output statement.
    <%! %> It includes only declarative statements.
    And also System.out.println can't be used in Jsp since it is a implicit object.out is already declared is jsp as implicit object.You can use it as out.println();in <%%>.
    Try to avoid scriplets in jsp.
    regards,
    satheesh kannan

  • When I try to print using Windows 2008 print server I have to use the generic print drivers supplied. If I use the OEM driver the printer locks up. I have tried a HP 4 plus and a Canon Copier.

    When I try to print using Windows 2008 print server I have to use the generic print drivers supplied. If I use the OEM driver the printer locks up. I have tried a HP 4 plus and a Canon Copier.

    A number of vendor drivers written for OS X cannot be used when connecting via SMB to a printer that is shared by Windows. This is due to limitations of the driver.
    In some cases, if you were to enable the LPD Print Service in Windows, you can connect to the share using the same syntax as SMB but on the Mac you would use the LPD as the protocol.
    If you can reply with the brand and model of printer you have then we may be able to provide more information.

  • Cannot  resolve symbol - attempt to use System.out.printf

    Hi All,
    I adapted a HelloWorld program to use
    System.out.printf instead of System.out.println (just for a test)
    The println comand compiles fine with no errors, but for some reason the printf generates compile time error. Please let me know what am doing wrong.
    Below is the error:
    d:\j2sdk1.4.1_05\bin>javac HelloWorld.java
    HelloWorld.java:6: cannot resolve symbol
    symbol : method Printf (java.lang.String,java.lang.String)
    location: class java.io.PrintStream
    System.out.printf("%s","Hello, world!");
    ^
    1 error
    code:
    public class HelloWorld {
    public static void main (String[] args) {
    System.out.printf("%s","Hello, world!");
    }

    If you check the documentation you can see this method was added in version 1.5
    http://java.sun.com/j2se/1.5.0/docs/api/java/io/PrintStream.html#printf(java.util.Locale,%20java.lang.String,%20java.lang.Object...)
    BTW: I suggest you use a current version of java, either 1.4.2_09 or 1.5.0_04

  • Using System.out.println

    I am migrating to a Sun server using Iplanet 6. I was on a HP-UX 11.0 server using Iplanet 4.2. I am having problems with two things. First, to get debugging information we use System.out.println in our servlets and JSP's. To get the output, we would redirect our start script when starting the server to a file. The trouble is now there is no output when using System.out.println.
    My second problem is request parameters. I do not always appear to get my request parameters in JSP's that use frames. The outer frameset uses request.getQueryString and then passes the query string to the two frames in the frameset. However, I do not appear to be doing that now.

    Instead of using System.out.println, try looking into the ServletContext.log method.
    I hope this helps with your first question.
    -Richard Burton

  • Is it possible not to use System.out.println?

    Hi guyz,
    Can anyone tell me if there is a way not to use System.out.println but produce the output on the command prompt? I need to add two numbers which are accepted through the args(command prompt). I have to add them and show them on command prompt without using System.out.println. Can ANYONE HELP?

    Hi guyz,
    Can anyone tell me if there is a way not
    s a way not to use System.out.println but produce the
    output on the command prompt? I need to add two
    numbers which are accepted through the args(command
    prompt). I have to add them and show them on command
    prompt without using System.out.println. Can ANYONE
    HELP?Why can't you use System.out.println? What's the reason?
    Kaj

  • How use system.out.println with a Java Swing Applet?

    Hi guys,
    I was just wondering what can I use to view output on the Java console with a Java Swing Applet?
    At the moment I'm using a JTextArea within the Applet for debugging but I want output to appear in the browser java console but system.out.println doesn't work.
    I'm viewing the Swing Applet on Netscape 4.7 browser.
    Any ideas?

    System.out.println()s work fine! I'm guessing that your problem is that you are looking at the wrong console window!
    You're using the Java Plug-in, right? On Windows, go to your Control Panel and double click "Java Plug-in". You should find a checkbox option to "Show Java Console" - make sure this is checked. Next time you fire up you JApplet, you should see a Java Console window popup.
    Hope this helps!

  • How do I print from my iPad 3 using a Canon printer?

    I just got the new iPad 3 and I was wondering if anybody could help me out. I hope this is possible, but I was trying to print from my iPad 3 using my Canon MP640r printer. I understand that it's not a Mac printer and there are only certain printers that are automatically compatible, but I figured with all of the capabilities of the iPad that somebody must have figured out a way of doing this.
    This wouldn't be the end of the world for me but I would really like to get my iPad to print from my Canon MP640r as it would be the icing on the cake and make my life a lot easier.
    Thanks a lot.

    Thank you so much, that worked like a charm.
    I appreciate it a lot.

  • Printing on chars on the same line using system.out.println

    i have the following string:
    String msg = "This is a message brought to you by one and the only";
    msg.toCharArray(); //converted to a char array.
    i've written a loop which goes through each of the char elements
    and puts it in it's own array:
    int i = 0;             
    while (i < msg.length)
                    char[] test = {msg};
    System.out.println(test);
    the problem is system out println prints out each of the elements on seperate lines is
    it possible to have them in one line to reform the original string?

    No exactly sure what you are trying to do. Does this
    help?
    String msg = "This is a message brought to you by one
    and the only";
    char[] test = msg.toCharArray();
    System.out.println(test);
    not really because i want to convert the string to a char array and then reform it in another char array and then i can choose which elements i want included and not to be so that it can be printed on the same line. I can do it the following way:
    char[] test = {test[0], test[1]]};
    but say i want all the letters containing the chracter T (and again i can use the above solution and select the elements from the string but i don't want to hardcode it, say the string changes etc) in the test array so then i thought of writing a loop:
    while (test[i] == 'T')
    char[] test2 = {test[i]};
    System.out.println(test);
    i++;
    but it puts each T in a new line...

  • How to merge 3 different query results using full outer join?

     Hi all This is my my query for 2 results
    with t1 as (
    select trans.crAcc_id,trans.cr_amt,row_number() over (order by trans.head_id) rn from Acttrans trans,
     Acttranhead head where trans.head_id in(select link_id from acttrans where head_id=12) and trans.crAcc_id!=0
     and head.head_id=trans.head_id
    t2 as (
    select trans.drAcc_id,trans.dr_amt,head.[Vouc_No],head.[Vouc_Date] ,head.[Check_No],head.[Check_Date],head.[stat],row_number() over (order by trans.head_id) rn from Acttrans trans,
     Acttranhead head where trans.head_id=12 and trans.drAcc_id!=0
     and head.head_id=trans.head_id
     select t1.crAcc_id, t1.cr_amt,t2.[Vouc_No],t2.[Vouc_Date] ,t2.[Check_No],t2.[Check_Date],t2.[stat],t2.drAcc_id,t2.dr_amt from t1
      full outer join t2 on t1.rn = t2.rn
    Query 3: SELECT [CrAcc_Id]  FROM [KSSDATA].[dbo].[ActTrans] where head_id=12 and crAcc_id!=0
    and i want to add Query3 result to the ABOVE RESULT but i am unable add third result using full outer join
    Thanks
    Balu D

    >>>but i am unable add third result using full outer join
    Do you get the error or wrong result?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to Protect mod_plsql DAD with SSO using SSL

    Hi,
    I am not able to set up any DAD with SSO using SSL. I have processed all issues depending on the Note:273379.1 "How to Protect mod_plsql DAD with SSO".
    When I am not using ssl, my DAD with SSO will work properly.
    But when I am using ssl, my DAD (http://host_name/pls/testsso) will redirect any page to SSO login through http (not through https).
    Any ideas?
    AS 10.1.2.0.2

    Did you run ossoreg.jar to update your osso.conf with the SSL entry for SSO ?

  • Printing an iframe with pdf using javascript is not working in IE8 and above

    I have a problem with printing and Iframe with PDF in IE 8 and above
    Following is my javascript:
    var urlValue="";//Path of the file to be printed
    var div = document.getElementById("printerDiv");
    div.innerHTML = '<iframe src="' + urlValue + '" id="frame" name="frame" style="width:100%;height:100%;"></iframe>';
    frame.focus();
    frame.print();
    This same thing is working fine in other browser but for IE is just not invoking the print dialog.
    Also I tried to get the frame.print(); on load of the frame but even that is not working exactly as that way it print the parent window in output.
    Few things I tried like:
    1) div.innerHTML = '<iframe src="' + urlValue + '"
    onload="this.contentWindow.print();"></iframe>';
    2) frame.contentWindow.focus();
    frame.contentWindow.print();
    3) window.document.getElementsByTagName('iframe')['frame'].onload = (function () {
    frame.focus();
    frame.print();
    I need to get the print of only the content which is in Iframe which I am binding in "printerDiv" by javascript.
    Any perfect/different solution from which I have tried then please post here?
    Thanks.

    PDF documents are hosted in an ActiveX or netscape plugin control which have their own printing functions.
    Start>Adobe Reader>Edit>Preferences - to adjust what functionality the PDF document viewer addon displays (menus etc).
    Tools>Manage Addons>Show all addons
    make sure you have both the x86 and x64 versions of your PDF reader Active X control installed and enabled. I would recommend also that you update to the latest version of the vendors' (Adobe?) plugin.
    Possibly you have disabled scripting of ActiveX controls in the IE security zone that your parent page maps to. Also there is an IE security zone feature that prevents navigation to a domain in a zone of lower integrity.
    Tools>Internet Options>Security tab, click "Reset all zones to default".
    when asking developer related questions it is helpful if you can include a link to your website.
    Rob^_^

Maybe you are looking for

  • How can I go back to a previous boot ROM version?

    Hi. I've been reading these forums for a long time...first time posting. The short story: I have a Macbook 5,2 running OS X 10.5 with boot ROM MB52.0088.B06, and I'd like to know how to flash the boot ROM version back to MB52.0088.B05. The long story

  • Premiere Elements 13 crash

    I created a short movie, less than 2 minutes, then tried to render it.  After a few minutes an error message appeared, "problem encountered", and shortly after PE 13 crashed.  It appears that I lost the entire project -- a lot of work! I'm new to Pre

  • For each loop with multidimensional arrays?

    Hi.I have a problem with for each and multidimensional combination. public class TestCards static int[][] dizi={{1,2},{3,4}}; static int t ; public static void main(String[]args)      for (int[] i : dizi)      System.out.println(i); The result of the

  • I cannot access anything in icloud

    I am able to sign in to iCloud but when attempting to open mail, contacts or anything else I receive the message "cannot load mail" "there was a problem loading the application".  I have been to "accounts" and everything appears to be in order.

  • Error while using Enumeration and Vectors

    Hi all, I am new bee in java i am using enumeration and vectors in my JSP page, i want to get the values from JSP page using enumeration and store then in Vector, below is the code, its giving errors saying ArrayIndexoutofException pls help, thanx in