Sir, really it's a great platform for learning Java.Can we get few list of questions for Java Programming which will be helpful to us to practice the codes
What if I don't ever use any sort of command-line arguments....do I still need to mention the args[] as a parameter in main()? Because, in such case I don't see any need of this args[]. Thanks in advance!
hi even though you are not using any inputs through command line we have to pass an array args[] inside the main function. compiler will search the main with the format so we have to include this args[].
hi here c is the output variable so output is addition of two integers which will always be integer so we need not go for typecasting. Hope your doubt has been clarified.Thanks for your support towards our channel.
Sir can we determine the size of args[] and what if we don't write the String args[] as arguments but we input numbers by scanner class. Will the program be successfully executed or there will be an error?
Hello sir just a small correction at 9:41 ,we can save a java file with any name , there is no relationship between the file name and the class name consisting of the main method. The relationship is there between the public class name and file name , if a class is declared as public then only it's fine name should be the same as the class name. Thank you.
hi sir im a begginer to java (sry about my silly doubts ): The command line argument passing you are refering to : is it the console in IDE or the actual command prompt in windows for the user to pass the value.
there is one thing wrong in this video, that is we can't run .class file using java command. we can only run .jar file, because it has executable code of our program, .class file is just a compiled file, we can still read a .class file using java code editor, but we can't read a .jar file because it has bytecode in it.
got an error. below is my code. Please tell me whats the mistake in my code class Add1 { public static void main( String args[2]) { int a,b,c ; a = Integer.parseInt(args[0]); b = Integer.parseInt(args[1]); c = a+b; System.out.println(c); } } #error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at Add1.main(Add1.java:5)
String is universal. Suppose you write: java program 56 43 abc. It will throw an exception right there, because you declared args as int. But String will receive any value and parse it into anything you want.
I have a doubt !! If we want to inform the user to enter valid data through commandline . How do we achieve that? Means validating user input and informing him to enter valid data if he enters valid data through commandline itself
Yes...here you must create an object using Bufferedreader,because there we typecasting the integer values to string.................hope u understand it....🙂🤗
Hi mohit Assume the file name is saved as CMD.java Hope your doubt has been clarified. Thank you for watching our channel and share my sessions with your friends and keep following our channel
Finally, you give a good concept. Thanks for sharing
Sir, really it's a great platform for learning Java.Can we get few list of questions for Java Programming which will be helpful to us to practice the codes
Bro can you send me practice programs
Woww literally shocked by your teaching very clear explanation keep rocking bro🔥🔥
Wowww just amazing
Sir you are really great for better explaination
Your videos are helpful...
Ur explanation is so good sir
Can u please give lecture on wrapper classes sir?
Sir you are super❤️ , concepts are easily understandable
makes more videos on java programming
first view of this nice video
excellent sir 👍👍😍😍
Finally I understand String args[] lol...... Thanks!
Good explanation
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Add.main(Add.java:6)
Excellent presentation ! So you can declare a main function inside a body of a class? In C that is not possible !!
What if I don't ever use any sort of command-line arguments....do I still need to mention the args[] as a parameter in main()? Because, in such case I don't see any need of this args[].
Thanks in advance!
@Sundeep sir !! Can you please answer this question.
hi
even though you are not using any inputs through command line we have to pass an array args[] inside the main function. compiler will search the main with the format so we have to include this args[].
Sundeep Saradhi Kanthety Got it!! Thanks sir :)
Thank-you for the q&a
@@sundeepsaradhi sir can you plz give me notes of Java and python plz
Your teaching was fabulous but we can't understand in english so, please do in telugu sir..!🙏🙏🙏🙏🙏🙏
Sir, please do these core java classes in telugu sir..🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏
But great explanation
Thank you 🙂
Explain command line arguments
How to get many command line arguments one by one in java. Like
Input : hello
Output: hii
Input: how r u
Output: fine
@@KumaranKM
Sir did you use thread concept?
Sir please explain lab practical programs factorial of list of numbers reading input as command line argument
Hi sir nice explanation I have a doubt
If we give an input as 5 then the output should be five can u print this using clm??
Should we give command line arguments only in Main function
sir, are these 2 arguments in main() the same String args[] and String[] args. Both are seen used
sir c is declare as integer by why you didn't write IntegerparseInt() function for variable since the system takes it as the string
hi
here c is the output variable so output is addition of two integers which will always be integer so we need not go for typecasting.
Hope your doubt has been clarified.Thanks for your support towards our channel.
Sir can we determine the size of args[] and what if we don't write the String args[] as arguments but we input numbers by scanner class. Will the program be successfully executed or there will be an error?
Yeah same doubt
Hello sir, your explanation is good,but I have a doubt that can't we write the above program without type casting?
sir, if we write scanner in the function what changes will be made in output and input
Subtitles is good sir but it is some disturbing to program is not visible in bottom so
You are my god!
Sir please upload tutorial on c program
What is the usage or advantage of using this buffer reader?
Hi
Budferedreader is also used to take inputs from a file or keyboard
Hello sir just a small correction at 9:41 ,we can save a java file with any name , there is no relationship between the file name and the class name consisting of the main method. The relationship is there between the public class name and file name , if a class is declared as public then only it's fine name should be the same as the class name.
Thank you.
if we are not using cmd(using eclipse) then we no need to write like integer.pareseInt(arg[])
please rectify my doubt.
Hi
Even though you are not using command line arguments the input is taken as string so we have convert the data type
hi sir im a begginer to java (sry about my silly doubts ): The command line argument passing you are refering to : is it the console in IDE or the actual command prompt in windows for the user to pass the value.
Its command prompt where we compile and execute the file(typed in notepad).
When we run that program it was showing arrayindexboundexception
Jose present
there is one thing wrong in this video, that is we can't run .class file using java command.
we can only run .jar file, because it has executable code of our program, .class file is just a compiled file, we can still read a .class file using java code editor, but we can't read a .jar file because it has bytecode in it.
Sir why you not show the program in eclips so we can easily understand it
Sir I have problem of explanation thread main java.lang.arrayindexoutofboundsexcpetion :2 what I do?
thank you !
Sir it showing ArrayIndexOutOfBoundException
Sir i am execute the program,it shows no error,but to run the program it shows ArrayIndexOutOfBound Exception can you clarify please
hii sir
what about System.err??
got an error. below is my code. Please tell me whats the mistake in my code
class Add1 {
public static void main( String args[2])
{
int a,b,c ;
a = Integer.parseInt(args[0]);
b = Integer.parseInt(args[1]);
c = a+b;
System.out.println(c);
}
}
#error Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at Add1.main(Add1.java:5)
Hi Vivek
Not require to mention the size of argument array in main . So write
public static void main(String args[ ]).
Sir, why is it a STRING ARRAY by default? Can it be int args[ ]? If not, why?
Other to string conversion is easy and most of devlopers used string data type.
String is universal. Suppose you write: java program 56 43 abc. It will throw an exception right there, because you declared args as int. But String will receive any value and parse it into anything you want.
Sir array declaration portions missing
Sir, I write the same program in TCS DRC test, but it was showing arrayIndexOutOfBound error
Same here, did you find the solution?
Please explain if you got it.
Sir i have a big doubt why we use this CMD line simply we can use scanner class. ok we use this CMD then what is the advantage?
Because...the time completion to run the program is lesser than compared to Scanner class.....
I have a doubt !! If we want to inform the user to enter valid data through commandline . How do we achieve that? Means validating user input and informing him to enter valid data if he enters valid data through commandline itself
You can use try-catch
I am confused for what is byte code
I got errors while using those type cast methods
Gd after noon sir ,it shows error during compilation
Yes...here you must create an object using Bufferedreader,because there we typecasting the integer values to string.................hope u understand it....🙂🤗
Sir please dubbing in tamil
Sir , What is CMD ?
Hi mohit
Assume the file name is saved as CMD.java
Hope your doubt has been clarified.
Thank you for watching our channel and share my sessions with your friends and keep following our channel
@@sundeepsaradhi
Yes Sir my Doubt is clear Now Thanks for giving lectures I am sharing your Channel as much I can👍👍
This program shows me an error
hi sir i have doubt where did you buy your tshirt .its very good looking hot
Sry cla??
why did u write Intege.paseint
Whatever we enter in command line will be in the form of string to convert it to integer we use integer.parseInt();
@@knoorjahan226 can you have larger number program using compand line program