20th Dec 2020, 4:55 PM
Name
Name - avatar
7 Réponses
+ 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.
20th Dec 2020, 5:01 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 4
How much you want to short it buddy???It already comes in a very short code category.....
20th Dec 2020, 5:04 PM
Abhinav Raj
Abhinav Raj - avatar
+ 4
You can short the object name of Scanner....and variable name....like Scanner a=new Scanner(System.in); Int n=a.nextInt();
20th Dec 2020, 5:09 PM
Abhinav Raj
Abhinav Raj - avatar
0
thanks
20th Dec 2020, 5:04 PM
Name
Name - avatar
0
I mean for getting user input in python I wrote, variable = input () in one line can I do this in Java?
20th Dec 2020, 5:06 PM
Name
Name - avatar
0
No....
20th Dec 2020, 5:07 PM
Abhinav Raj
Abhinav Raj - avatar
0
ooo ok thanks..
20th Dec 2020, 5:08 PM
Name
Name - avatar