Questions tagged [system.out]

Predefined stream object attached to the standard output in Java console applications.

It's a static variable in Java's System class. This tag is intended for questions about Java applications that write to the standard output.

404 questions
3
votes
4 answers

System.out.print is printing two lines/questions at the same time. What am I doing wrong?

So i am working on an assignment for class and after i went through and fixed all of the errors the compiler found i get this when running the program: J:\Java Class>java AddressDemo What is your Street's name? Unknown RD What is your…
EpOcH91
  • 47
  • 2
  • 5
3
votes
1 answer

ProcessBuilder.inheritIO() sending output to the wrong place

I am using inheritIO() to redirect output from a child process in my program to the System.out and System.err, and input to System.in. These are all redirected by System.setOut() and the like: // Reassign System…
Mike Carpenter
  • 197
  • 1
  • 2
  • 9
3
votes
1 answer

Message are printing after closing the chat

I am developing a simple ejabberd chat using smack api. I want to make a single program for both sender and receiver side. The idea is like this: Upon running program asks the user whether you want to chat with someone (i.e. wants to be a sender)…
Abhishek Gupta
  • 6,465
  • 10
  • 50
  • 82
3
votes
1 answer

How to make Redirect.INHERIT and System.setOut work together

This may be a trivial question but I can't easily find an answer. I've got a simple program in Java: System.setOut(new PrintStream(new File("stdout.txt"))); ... ... ProcessBuilder pb = new ProcessBuilder("... some args…
Jacek
  • 1,048
  • 15
  • 21
3
votes
1 answer

How can I make this statement (within a while-loop) not print out twice to the console?

I am very new to Java, (and to programming altogether). I am sure that the solution to my problem is very simple, but I just can't figure it out. The code below is a small chunk of my program. But it is still compile-able, and still has the same…
3
votes
6 answers

Does Java run anything for System.out.println(...) when there is no console?

Does Java run any code for System.out.println(...) when I run the program in a console-less GUI? (where I don't redirect the program output to anywhere) In fact I'd like to know if System.out.println(...) can affect the program performance when it…
Johnny
  • 1,509
  • 5
  • 25
  • 38
3
votes
2 answers

why is System.out.prinln out of order?

Every now and again I want to use System.out.prinln to debug things instead of using a debugger, or I want a simple program to write to standard output so that I can log something without taking the time to get proper logging set up. I've noticed…
David
  • 14,569
  • 34
  • 78
  • 107
3
votes
3 answers

Swing console window that displays System.out/err while a program is running

How do I create a Swing console window that displays System.out/err while a program is running? I have an application that uses a lot of System.out status updates that I'd like to migrate out of Eclipse and into a self-contained .jar. I've been…
ChickenWing
  • 639
  • 9
  • 24
3
votes
2 answers

Java - Mac/Windows with System.out.println()

We all mostly use System.out.println in the Console of our IDE. I am using Eclipse. I can also clearly see the println() message on my Mac's Console app. Which is nice for my personal things. And here is the code: public class Main { public…
coffeemonitor
  • 12,780
  • 34
  • 99
  • 149
3
votes
8 answers

How to read console output in j2me cellphones? Where does System.out.println() go?

When writing j2me applications for cellphones, using System.out.println() prints on the console if using an emulator. However, when the code is deployed on a cellphone, where does the console output go? If it is impossible to see this in the…
Animesh
  • 1,765
  • 2
  • 22
  • 36
3
votes
2 answers

sending System.out over socket

How do I send output from System.out to socket e.g. PrintWriter? I need to send whatever appears on the console output (both std and err) to PrintWriter, thus a socket. Thank you.
user1444046
2
votes
4 answers

Is there a way to fire a trigger from System.out.println?

This might be a very dumb question but, is there a way to fire a trigger whenever something is printed to the console in Java and listen for it somewhere else? I have very little understanding of triggers or of the System class (or of Logger for…
Nacht
  • 10,488
  • 8
  • 31
  • 39
2
votes
1 answer

Java Scanner is appearing before print()

I am trying to print a string before asking for the input while using Scanner, but it keeps making the input appear before the string. I can't find any reason why it's doing this. I have attached the full code below. import…
jrsevans
  • 47
  • 5
2
votes
2 answers

Java: How to configure System.out to have autoflush enabled?

I used reflection like so to print out the properties of the System.out object: System.out.println("Class: " + System.out.getClass().getName()); for (Field field : ObjectUtils.getAllFields(System.out)) { field.setAccessible(true); …
Dasmowenator
  • 5,505
  • 5
  • 36
  • 50
2
votes
1 answer

Netbeans 9 - Print Unicode Characters

With Netbeans 9: Product Version: Apache NetBeans IDE 9.0 (Build incubator-netbeans-release-334-on-20180708) Java: 1.8.0_181; Java HotSpot(TM) 64-Bit Server VM 25.181-b13 Runtime: Java(TM) SE Runtime Environment 1.8.0_181-b13 System: Windows 10…
donnadulcinea
  • 1,854
  • 2
  • 25
  • 37