#5 Mastering the Java Main Method Command Line Basics

Published: 07 December 2024
on channel: JAVA CLASSES BY RASHMI SIR
9
1

Now see I just show you Now here you check I just write here there is a pine public here you see class there it is x is a class Inside that I just write here there it is public static there it is void Maine Once I pass here I just write a string a-r-g-s You know that that is the that is word I'm just enter into word that is called as word that is the main method Within that I just write int x is equal to 100 I pass Int y is equal to that is args dot length I pass here You know that uh what is the meaning of args dot length That is the length of the command line argument Now what I can do here if I write here that is within the try block because uh you know the concept That is if that is what args length is 0 I am not passing a command line argument then my program must be terminated because when I divide a number by 0 then it generates exception So I am using the try block I just write here that is system out printalign I just write here that is result is Here you see the result is I just write x by y Anyway I just write But you know the concept uh this dry block may generate exception When it generate exception what type of exception may generate uh that is here you see catch Which exception may generate Arithmetic There is a exception here you see Arithmetic exception A That is the catch block You see if exception arise then catch block executed If exception not arise catch block never be executed You know the concept


On this page of the site you can watch the video online #5 Mastering the Java Main Method Command Line Basics with a duration of hours minute second in good quality, which was uploaded by the user JAVA CLASSES BY RASHMI SIR 07 December 2024, share the link with friends and acquaintances, this video has already been watched 9 times on youtube and it was liked by 1 viewers. Enjoy your viewing!