Questions tagged [println]

In programming, `println` generally prints out the arguments given, then moves to a new line for subsequent output.

In programming, println generally outputs the arguments supplied, then moves to a new line for any further output operations. For example, in Java you could write the following:

System.out.print("Hello ");
System.out.println("World");
System.out.println("Goodbye");

And the console would output (with \n representing newline characters):

Hello World\n
Goodbye\n

There are several languages that use the println() method; Others have different syntax that accomplishes the same functionality.

617 questions
11
votes
4 answers

Show System.out.println output with another color

I have a big project to debug, and I was wondering if there is anyway I could use to change the System.out.println method in the output of eclipse for example : System.out.println("I want this to be red"); System.out.println("I want this to be…
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
10
votes
4 answers

scala - trying to print overridden toString method

the bellow code : scala> class A { | def hi = "Hello from A" | override def toString = getClass.getName | } defined class A scala> val a = new A() a: A = A scala> a.toString res10: String = A scala>…
Juan Salvador
  • 407
  • 9
  • 15
10
votes
5 answers

Difference between println and print in Swift

The use of println and print in Swift both print to the console. But the only difference between them seems to be that println returns to the next line whereas print will not. For example: println("hello world") println("another world") will output…
wigging
  • 8,492
  • 12
  • 75
  • 117
9
votes
1 answer

How to log the files of the gradle copy method?

Is it possible with println inside the method copy to print all file names to the console. Or is there another option to print the copied files? copy { from "${source}" into "${target}" include "foo" include "xyz" println ??? }
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
9
votes
1 answer

Printing NSManagedObject subclassed Core Data object to console returns empty line in Swift

I am working on an Swift app with Core Data. I created my *.xcdatamodeld file and created a NSManagedObject Subclass (Editor -> Create NSManagedObject Subclass...). Everything works fine except when I try to println an instantiated object of that…
opfeffer
  • 603
  • 5
  • 19
9
votes
3 answers

Concatenate mixed types for println

I am trying to concatenate a string and an integer, and log to the console using println. println("Load number: " + webViewLoads) webViewLoads is type 'Int'. As I'm mixing two types here, there is no surprise that I'm getting an error: Could not…
kmiklas
  • 13,085
  • 22
  • 67
  • 103
9
votes
6 answers

How to `Serial.print()` "full" hexadecimal bytes?

I am programming Arduino and I am trying to Serial.print() bytes in hexadecimal format "the my way" (keep reading for more information). That is, by using the following code byte byte1 = 0xA2; byte byte2 = 0x05; byte byte3 =…
Backo
  • 18,291
  • 27
  • 103
  • 170
9
votes
6 answers

Time complexity of system.out.println

I've been told different things over my course on algorithms, and was wondering if I could get a definitive answer as to the time complexity of Java's System.out.println() command. For example, what would the time complexity of the following be,…
Addison
  • 7,322
  • 2
  • 39
  • 55
9
votes
2 answers

Where does system.out.println print from a JSP?

Where does tomcat put the System.out.println output ? I'm not interested in out.println. I'm using a system that uses system.out to log issues, like login success/fail, and I need to look to that generated "log".
Eduardo Moniz
  • 2,095
  • 3
  • 18
  • 27
9
votes
3 answers

Scala println not working with App trait

When I use the scala App trait, I can't get println to work. This simple example prints as expected, object HelloWorld { def main(args: Array[String]) { println("Hello, world!") } } But once I introduce the trait it does not, object…
James McMahon
  • 48,506
  • 64
  • 207
  • 283
8
votes
6 answers

Character limit for System.out.println() in Java

Is there any character limit for the output of Java's System.out.println(String x) statement? When I try to print some XML from a web service call using System.out.println(), only a portion of it is actually printed in the console. The XML string…
TKV
  • 2,533
  • 11
  • 43
  • 56
8
votes
2 answers

what is the purpose of using System.out.println()

I was going through the internal implementation of System.out.println().Though I understood how this is working but couldn't figure out : Why they decided to use the System class in the first place. They could have directly used PrintStream class…
Ankush Dutt
  • 143
  • 8
8
votes
1 answer

difference between printf and println in java?

Just came to know that java does has a method named printf, then what is the difference between printf & println?
Bhargav Modi
  • 2,605
  • 3
  • 29
  • 49
8
votes
1 answer

Alternative for println in Scala

I am required to print huge amounts of data ( in the order of a few 100 MBs) on the console. Using println for this is failing miserably on IntelliJ. Is there any alternative like console.log which can handle and display this data without lagging…
joanOfArc
  • 467
  • 1
  • 6
  • 16
7
votes
3 answers

What does an integer that has zero in front of it mean and how can I print it?

class test{ public static void main(String args[]){ int a = 011; System.out.println(a); } } Why I am getting 9 as output instead of 011? How can I get 011 as output?
Dhanuka Perera
  • 1,395
  • 3
  • 19
  • 29
1 2
3
41 42