0
Can I shorten this?
7 Respuestas
+ 4
Minification costs readability.
Shorter but less readable:
public class P{public static void main(String[] a){System.out.println(new java.util.Scanner(System.in).nextInt());}}
I removed all variables (except a) and import statement. I also shortened class name and argument name.
+ 4
How much you want to short it buddy???It already comes in a very short code category.....
+ 4
You can short the object name of Scanner....and variable name....like
Scanner a=new Scanner(System.in);
Int n=a.nextInt();
0
thanks
0
I mean for getting user input in python I wrote,
variable = input ()
in one line
can I do this in Java?
0
No....
0
ooo ok thanks..