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
1 answer

can i write a similar class as "System" for printing something?

can i build a user-defined class for printing anything using printstream variable just as "System" class ? so what i did is: import java.io.*; public final class SystemDemo{ public final static InputStream give=null;//the same…
nikhil2000
  • 178
  • 3
  • 15
-3
votes
2 answers

How to output multiple characters as one word in Java

The code below takes user inputted integers and converts them into ASCII symbols. public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int charCount = in.nextInt(); for (int i…
Ibraheem Ahmed
  • 11,652
  • 2
  • 48
  • 54
-3
votes
4 answers

Java Class does nothing

I want to print an 2 dimensional double Array to the console. public class arrayprinter { public static void main(String[] args) { double[][] multi = new double[][]{ { 10, 20, 30, 40, 50}, { 1.1, 2.2, 3.3,…
Colin
  • 1,112
  • 1
  • 16
  • 27
-3
votes
2 answers

What's wrong with how I'm using Inheritance in Java?

Sorry, I know that this code can be shortened significantly here and there, I just haven't really gotten how inheritance really works. My question is, how do I make it so that the methods within my machoke and machop class don't print out those…
-3
votes
1 answer

System.out.println(RAWR); not showing up on console

public void run(){ while (running){ System.out.println("RAWR"); } } I am learning java through watching a person on youtube and for some reason I cannot get this part to work please look over and…
-3
votes
1 answer

How to read console output from Grails

My grails app has an external java library which I developed. I want my grails app to be able to display my java library system.out statements (console output). How do I go about doing that? I would rather not have to write it out to a file then…
hat_to_the_back
  • 99
  • 1
  • 12
-3
votes
3 answers

Program will not execute unless using System.out.println()

public class Main { public static void main(String[] args) { GUI gui = new GUI(); GameHandler gameHandler = new GameHandler(); while (!gui.shouldStop()) { while (gui.isRunning()) { …
-4
votes
1 answer

System.out.print not displaying ArrayList
The object "accountData" will not display in the console in the CloseAccount() method. I have tried various variants of the for loop but it just either displays "0." after the header or nothing at all after the header. I just want to be able to…
hevansa98
  • 87
  • 1
  • 1
  • 8
-4
votes
1 answer

how to make two number and text on same line

okay so i cant seem to get the variable "mChoc" and "fChoc" on the same line as "you should eat" and "chocolate bars if you are male/female to maintain your weight." could i get some help. ive been reading all over my text book and cant seem to find…
-4
votes
1 answer

System.out in java

how to carry test on the class below with System.out in java - where and how should i put the System.out script public class DtaPlusMethods { public static void main(String[] args) { } private double a = 1.0; private double b =…
kevin
  • 13
  • 6
-5
votes
5 answers

How come Java does not store the value a method calculates when I system.out.println?

I've been stumped over the concept of the return keyword and how it behaves. I've been playing around a bit and found some behavior I can't explain. In my code below, I have a simple calculateScore() method that has a formula. When the first method…
-6
votes
5 answers

What exactly happens when you print output in Java?

Can anyone explain, what exactly happens in the following line? java.lang.System.out.print("string" + i); It will print "string" followed immediately by value of integer i, but what is happening here? What is the significance of every part of this…
LucasSeveryn
  • 5,984
  • 8
  • 38
  • 65
-6
votes
1 answer

System.out.println("Hello"); = (No explicit return value)

Tried printing Hello. But nothing was printed on console. It returned the value as (void). Suggest a solution Attached the expression as image. @Service("DetailsDAO") public class DetailsDAOImpl implements DetailsDAO { private static final…
Prakash
  • 1
  • 2
-6
votes
2 answers

Java school exercise

So, I have to write a new class method called "insert." What insert does, is it takes the arguments Item[] array, Item newitem, and int k, and it inserts new item into the array at index k. Part of this code I can change, and part of it I can't.…
user3363511
  • 79
  • 1
  • 1
  • 7
1 2 3
26
27