I am extremely new to Java (just started this weekend) and have a background in Perl. So I have a question:
What is the Java equivalent to the Perl Diamond Operator (<>)?
So basically what is Java’s equivalent to:
print "What is your name?";
my $name = <>;
print "Hello, $name!";
Thanks in advance!
For those not knowledgeable of Perl:
As used, <> is short for readline(ARGV), where ARGV is a special file handle that represents either STDIN (if no arguments were passed to the program) or the concatenation of the content of the files passed as arguments to the program. readline does not remove the line terminator.
Well, java is not a scripting language and it’s designed for different things.
Anyhow, similar code in java might look like this: