#Java println vs =print

1 messages · Page 1 of 1 (latest)

zealous isle
#

when I use println it prints out Name:
but when I use print instead it does not print anything and keeps loading.

trim fulcrumBOT
#

<@&987246399047479336> please have a look, thanks.

trim fulcrumBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

long silo
#

generally, i doubt that

#

u can try to use System.out.flush() after it, but i have rarely ever seen an actual effect of it

#

its more likely that ur just misinterpreting something

#

hard to tell without seeing the actual code though

#

u seem to also run into the classic misconception of having input and output in the same line

#

which is incorrect. it's two absolutely different and independent channels

#

it's just ur ide the decided to draw both in the same line

#

so u might also just run into the blocking scanner call, waiting for input - before the console decided to print out the text

#

since, as said, it's two independent things

indigo geyser
#

It's a NetBeans (terminal) bug. It doesn't flush stdout when reading from stdin.