How To Take Command Line Inputs In Java - For Beginners

Pubblicato il: 29 giugno 2017
sul canale di: 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  


In questa pagina del sito puoi guardare il video online How To Take Command Line Inputs In Java - For Beginners della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Computer Analyst 29 giugno 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 94 volte e gli è piaciuto 0 spettatori. Buona visione!