How To Take Command Line Inputs In Java - For Beginners

Veröffentlicht am: 29 Juni 2017
auf dem Kanal: Computer Analyst
94
0

Code :
public class A
{
public static void main(String args[])
{
int a = Integer.parseInt(args[0]);
float b = Float.parseFloat(args[1]);
double c = Double.parseDouble(args[2]);
System.out.println(a+" "+b+" "+c+" "+args[3]);
}
}

--------------------------------------------------------------------

Explaination :

Here, Integer, Double and Float are wrapper classes
which consists of method parseInt(String), parseFloat(String) and parseDouble(String)

parseInt() - converts the string parameter into integer value..

parseFloat() - converts the string parameter into float value..

parseDouble() - converts the string parameter into double value..

-------------------------------------------------------------------------------------------------

Thanks for watching the video..

Plz do subscribe , like and share..

For any query, plz comment..
--------------------------------------------------------------------------------------

Video Link To Set Path For Java in Windows :
   • How To Set Path For Java in Windows -...  

-------------------------------------------------

Follow On :
✅Instagram :   / computer_analyst.yt  
✅Google+ : https://plus.google.com/b/11676538144...
✅Twitter :   / yt_c_analyst  


Auf dieser Seite können Sie das Online-Video How To Take Command Line Inputs In Java - For Beginners mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Computer Analyst 29 Juni 2017 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 94 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!