Import java.util.Scanner;

import java.util.Scanner;
public class main{
public static void main(String args[]){
Scanner s = new Scanner(System.in);
String i = s.nextLine();
System.out.println(i);
s.close();
System.close();
}
}


i = input()
print(i)
exit()

Why is this allowed?

Other urls found in this thread:

docs.python.org/3/library/functions.html#input
twitter.com/SFWRedditGifs

What is input()?

Is this a language-vs-language shootdown? Here's a Haskell for ya.. main = getLine >>= putStrLn

Because java is shit made for retards, like you.

ewww

docs.python.org/3/library/functions.html#input

>public static void main(String args[])
absolutely disgusting
whose idea was this shit

in python2:

print raw_input()

Literally english

It's just boilerplate code, because Java is a verbose language.

>public static void main(String args[])
The disgusting placement of those square brackets contain the answer to the other question. Yes Java is so smart it will let retards run their shitty code so they don't cry. Except when they cry because it works nevertheless.

Read the documentation next time to produce good code and learn how and why does it work.

It literally means an array of strings.

String[] args, literally an array of strings, nobody except newcomers that don't understand what they're doing write the brackets after args, seems like it's nothing but tells a lot about how well he understood that.

Nobody writes that manually dude. I didn't even notice it.

puts gets

Come at me

The only reason why (String args[]) works is so that newcomer C/C++ coders don't throw a fit kek

What shitty software autogenerates the main method like that, contrary to the official Java documentation? I know for certain Eclipse certainly doesn't.

I mean I've never ever typed it manually after doing my first hello world in Java. It's something that doesn't really stand out to me

I get that you're memeing, but is System.close() even a real function? Google isn't giving me anything, bros.

public (visibility)
static (only one instance)
void (does not return anything)
main (starting point of the program)
Strings args[] (array of arguments that passed to the programm when launching)

If it was private there would be no way of knowing where to start
Static loads the methods/variables at startup, this way it is always available.

Blame OOP if anything.
Hopefully with java 10 there will be a Java REPL integrated in the language and you won't need a main method for each program you do. But this will come until 2020 maybe?

It does once you understand arrays. Also who copies and pastes the same code forever unless forever means less than the first 30 programs?

>copy and paste
nigga are you high
Intellij generates shitload of boiler code for you.

Read:

The point is that I literally do not even look at that part of the source code you dense fuck