I recently started learning Java and I had a few questions.
It is not clear to me why in Java there is no simple mechanism (method) for input / output of anything. That is, when in Pascal it is
write\reador Python -print\input. In Java, there is a standard output tool,System.out.println, but input needs to be implemented viaScannerimport.
Tell me something I don’t understand or is there really no such basic methods in such a powerful language?
Also, as I understand it,Scanneris only suitable for text, but what if I need to enter numbers? What to use? You can completely write how it will look.Please explain what the arguments in this command mean.
public static void main(String[] args)You can explain the principle of creating an instance of a class. For example:
String variable = new String ("Text");Why is why the
Stringclass is called twice at the beginning and at the time of creation?
I understand that you can just accept everything, but I don’t understand why this is an action, is there an explanation for this, or is it done just like that?