@cm0002@lemmy.world to Programmer Humor@programming.dev • 1 month agoDoes this exist anywhere outside of C++?lemmy.mlimagemessage-square49fedilinkarrow-up11arrow-down10cross-posted to: programmerhumor@lemmy.ml
arrow-up11arrow-down1imageDoes this exist anywhere outside of C++?lemmy.ml@cm0002@lemmy.world to Programmer Humor@programming.dev • 1 month agomessage-square49fedilinkcross-posted to: programmerhumor@lemmy.ml
minus-square@uranibaba@lemmy.worldlinkfedilink0•1 month agoI haven’t looked at the code but I always assumed that println was a call to print with a new line added to the original input. Something like this: void print(String text) { ... } void println(String text) { this.print(text + '\n'); }
minus-square@Scoopta@programming.devlinkfedilink0•1 month agoThat is pretty much what it does except it doesn’t hardcode \n but instead uses the proper line ending for the platform it’s running on.
I haven’t looked at the code but I always assumed that
println
was a call toprint
with a new line added to the original input.Something like this:
void print(String text) { ... } void println(String text) { this.print(text + '\n'); }
That is pretty much what it does except it doesn’t hardcode
\n
but instead uses the proper line ending for the platform it’s running on.