Functions / Methods in Java
Vložit
- čas přidán 3. 07. 2024
- All about #functions in Java from scratch! In this video, we cover in detail functions/methods in Java.
Starting with the syntax, we cover topics like types of arguments, how values are passed, scoping, shadowing, function overloading, with examples.
Take part in the learning in public initiative! Share your learnings on LinkedIn and Twitter with #DSAwithKunal & don't forget to tag us!
👉 Resources
- Join Replit: join.replit.com/kunal-kushwaha
- Complete Java DSA playlist: • Java + DSA + Interview...
- Code, Assignments, & Notes: github.com/kunal-kushwaha/DSA...
➡️ Connect with me: www.techwithkunal.com
=========================================
Timestamps:
0:00 Introduction
1:58 Problem Statement
5:31 Methods
5:41 Syntax of a Method
6:40 🎯 Program : Sum of two numbers
9:11 🎯 Program : Greetings
11:18 Returning Values
14:31 Returning a String
17:42 Parameters (Integer Function)
20:36 Parameters (String Function)
25:03 🎯 Program : Swap two numbers
25:25 🎯 Program : Pass Value
29:39 Internal Working of Swapping Program
41:33 🎯 Program : Change Value
46:41 Scope
47:00 Method Scope
49:46 Block Scope
55:32 Loop Scope
59:44 Shadowing
1:06:53 Variable Arguments (Varargs)
1:12:07 Method Overloading
1:19:25 🎯 Questions
1:20:01 Q1 : Prime Number
1:23:52 Q2 : Check Armstrong Number
1:28:27 Q3 : Print All 3 Digit Armstrong Numbers
1:30:18 Outro
#placement #dsa #interviews
Man the explanation is so perfect . Concepts of shadowing scoping varargs were made so easy. Great work!! Looking forward to Arrays❤️
Glad you liked it!
Agreed💯
@@KunalKushwaha I love you
@@KunalKushwaha Please keep posting,such a great content.
@@KunalKushwaha I can't get the notes
I couldn't thank you enough, but i pray may god give you strength and power to complete this course and also do many things great in life. I believe that if this course goes the same way its going now it will change life of lakhs.Thanks for being a helping hand
Ab toh sach bolde
To all the new comers : In 30:56 when Kunal says in Java there is no such thing as pass by reference he means that there is no any way by which we can pass the primitive data types as reference in java. For example in C++ we had & and * operators by which we could pass the memory address of any variable we want ( even primitive variables like int, char, float etc ) and we can always achieve pass by reference but in java there are no such & and * operators.
But in java we do have certain reference variables like classes, arrays. Since they are already a reference variable passing them through function might look like a pass by reference but that is because the variable name already is a reference to data in heap memory. So DO NOT BE CONFUSED
Thank you
Thanks Amrit
in call by value example when he pass the primitive value to the function he tells that here we not change the value of the object we create the new object this is wrong and he didn't explain right
thanks a lot
thanks dude
The best coding teacher i found in entire CZcams. You are just like beyond pro level ♥️
One more interesting observation about VarArgs:
If you have 2 functions with the same name (i.e you are overloading a function)
eg:- fun(int p,int q) and fun(int ...v)
and if you call fun(10, 20) from the main function
then function accepting the exact number of parameters( fun(int p, int q) in this case ) will be executed and VarArg function( fun(int ...v) in this case) will be ignored.
hope it helps! :)
Nice observation
So, it means if we call fun(10, 20, 30) or fun(10), then the fun( int ....v) will be executed, right.
@@vrashabhsontakke7282 yes
Yes Bro Notice that.
nice thank u😁😁
Very nice explanation, i am having more that 13 years of experience in java but still watching just to learn how you are teaching and explaining... very helpful for any new person who wants to understand java. Good job, much appreciated ... keep it up...as of now i have forwarded your chhanal link to more than 20 freshers... nice contribution towards community...
46:33 in java we dont have pointers....Me: Finally inner peace😂😂
Me too
@@KunalKushwaha lol Programming lang are made by and for lazy people.
😂😂😂😂😂😂😂😂😂😂
Wow great explanation.i want to marry you 😊
why u hate pointers?
now you are my only hope to learn dsa in a much simpler way. your way of explanation is perfect and crystal clear. thank you so much for such amazing content. ❤
Your teaching is highly comprehensible
It is not one of the best It is THE BEST course of DSA . Love you bro ❤❤
No
its part of core java😂you thinking it ds LOL😂
This is literally amazing explanation. I am at the 2nd year and still learnt alot from this amazing lecture!
Glad you enjoyed it!
Best in teaching. Clearing all doubts. Thankyou for this playlist.
I've learned Python and Dart in the past, and this course is exceptional in quality and depth. I'm truly impressed and grateful for the in-depth content. Thank you, and may your work continue to benefit many more students. 💌
Although I had already viewed this lecture, I came back to learn the concept of scoping more clearly
I just found the best way to understand scope.
So think the outer variables as the king and the inner variables in a block or loop to be the common people.
The king can visit the common peoples home at any time but common peoples can't visit the king usually.
It's something I came up in my mind & thought would be helpful for you.
my whole java syllabus of college is done by here only
thanks lot for making awesome videos
All the best
bhaiya kya clear kra h ye scoping ka concept ........🤩🤩
Your explanation is crystal clear . loved the style you teach the things so simply. You are doing great job ....
Such a great man.
I have no words to express my gratitude 🙏🏻
Thanks a lot
Super se bhi upar hai ye DSA playlist..Kudos To Kunal
Best paylist for DSA thank you so much kunal I started this just few days ago. I was very worried as I was not getting concepts . thanks for this great playlist❤
I was always struggling with this scoping thing, now its clear thanks kunal :)
1:22:46 At line no.24 we can also use return true instead of c*c>n because if above two conditons fails then c*c>n has to be true
Thank you, Kunal for making videos even on weekends for us. :)
Best DSA series ever I would like to say. Content made just for the sole purpose of teaching people. Thank you Kunal for such great explanations. you are truly a great Teacher.
It's my pleasure
@@KunalKushwaha sometimes i wonder how you such a gentleman , thank you for this series .
Best course on DSA . Far superior than many paid ones.
this is best method and function lecture for any one on the youtube.
You are putting video in sunday also.
Really appreciate your work.
And you are amazing teacher
Thanks brother you will going to create a new community with a student with best knowladge..
Couldn't have been explained in a better way. Keep growing and spreading your knowledge.
Thank you for this course bro.... highly appreciated. Thanks a lot ☺️
Kunal is going clear all my doubts in DSA...loved it
at 45:00 whosover is having doubt in change value read this: like in the video he has said that pass by value works on primitve datatypes like string, int char byte etc,whereas objects and stuffs like array which is not a primitive datatypes, its a reference variable(collection of ints or any data type that I declare) so that's why the value of arr[0] got changed since array itself was the reference.hope this might help
This will be an awesome one too!! I am commenting before even watching!! Thanks Kunal!
Loved the clear and correct explanation
The best bootcamp ever👌🏻
really beneficial for all of us!.
The channel should be named "Hey Kunal"
Love what you are doing sir. May God bless you.
Hey Kunal ur all vedios are so amazing that I can't express. Ur every vedio link that pops out I immediately click on that. Thank u so much for ur hard work and consistency. But plss don't stress urself so much upload vedios at ur own time ur health is also important.☺️☺️
You teach every single stuff very clearly
Finally I am satisfied with some lectures.thanks bhiya sooo much.
Thank you Kunal for your smart work
Hey Kunal i appreciate your hardwork bro, try to complete the course as soon as possible,in 2 months.
literally, you the cutie. to the point explaination. thank youuu sir!
Handwritten notes are the best for revising at the last moment. Amazing video Kunal ,Lots and lots of learning from this amazing lecture.
So nice of you
Where is handwritten notes... Can u share the link
did you complete the course?
Hand written notes plzz🥺🥺
Where is the notes?
I don't know about shadowing and varargs before but now I know that very well.
Wow the explanation is just so perfect i can surely say that ur the best best best programmer and a teacher is well ur just the BEST!!!! u just explained all these topics so easily that these are damn impactfull and easily understandable 👌👌👍👍🙏🙌
Thanks for the late-night video!
Thank you so much sir. Its very clear to understand each concept. Teaching is very nice. waiting for more videos like these.
Waiting for your dsa part ,i know basics of java ! ❤️
One of the best channel for java+dsa series
Bro you are nailing this course....Thanks a lottttttttt
love your lectures kunal , Best ever explanation❤❤
Thanks for such great videos. I am in class 10th and wanted to learn Java . Explanations are so simple that I can understand easily.❤️❤️
Any tips for me?
You are much man, you handled java the way it is really easy to understand the concepts
Kunal you'll definitely grow in your career, even an experienced developer can't give this level of explanation for functions.Keep up
he did
No, even a beginner would know that. I knew that stuff in my 1st semester
Well bhaiya, currently I don't have time to watch these lectures but even then I make sure to leave a thumbs up to your every video coz we trust you with all our heart. And most importantly at the end me too will follow this series. ❤
Why can't you follow this series now? What are u so busy with
As always, amazing content ✌️✌️
Okay so, had to watch the Pass by value and pass by copy of the value of the reference part, to make it more clearer, but yes, u made it clear enough ! ❤❤❤❤
amazing lecture kunal, hands on programming and problem solving is the best.
God bless you buddy! Great work for the community :)
Your teaching concepts are amazing bro❤
you are amazing bro!! much appreatiated 👏👏👏👏
After watching more than 8 video...i found a better explanation in this video... love you bro
Superb video! Thanks Kunal
You have nailing it bro!!
this is the best thing i have come across
This is the best explanation on functions!🔥
Glad it was helpful!
@@KunalKushwaha Bro from where can I practice questions on each topic ??
@@trusfrated_jungshook assignment link is in github link in the video description
@@KunalKushwaha thankx bro ❤
💯💯
Lots of love🥰🔥Well explained each and every concepts
awesome man the way you teaching in this age great ❤
Thank you so much!! I really mean it.
Thanku sir for this amazing lecture ❤🙏.
perfectly explained everything : You are doing great bhaiya
Best out of Best Brother Hats offf to you...
For scoping to be simple , folks, global scope objects is accessed by other scopes, but not vice versa and,
change in value in block scope may apply to global scope.
Great explanations! Kunal👍
Keep it up.
Good teaching comes from a good heart
Ur video s are really helpful, and we can understand quick ....
Just Amazing, This Course is better than paid courses.
Finest Video on this topic . Great Job Man Hatt's off to u
Kunal, The shadowing and VarArgs explanation was great. Appreciate af.
Great Explanation Sir🙏🙇♂✨❤
I thought that coding is hard after seeing your videos I am learning coding so easily...💥💥
amazing work man, appreciate it ♥
i have watched your previous videos and now I am giving likes to each of your video before even watching it Much respect
you are very kind
Completed. Waiting for the next
There's some magic in the way you teach.
Best course of all time
Timestamps:
0:00 Introduction
1:58 Problem Statement
5:31 Methods
5:41 Syntax of a Method
6:40 🎯 Program : Sum of two numbers
9:11 🎯 Program : Greetings
11:18 Returning Values
14:31 Returning a String
17:42 Parameters (Integer Function)
20:36 Parameters (String Function)
25:03 🎯 Program : Swap two numbers
25:25 🎯 Program : Pass Value
29:39 Internal Working of Swapping Program
41:33 🎯 Program : Change Value
46:41 Scope
47:00 Method Scope
49:46 Block Scope
55:32 Loop Scope
59:44 Shadowing
1:06:53 Variable Arguments (Varargs)
1:12:07 Method Overloading
1:19:25 🎯 Questions
1:20:01 Q1 : Prime Number
1:23:52 Q2 : Check Armstrong Number
1:28:27 Q3 : Print All 3 Digit Armstrong Numbers
1:30:18 Outro
Very very clean and really deep diving
Thanks a lot Sir ji❤🙏.
Really enjoying this vdos
THanks for this course
The 'opportunities' playlist was very helpful, please start it if possible for community classroom too .
Very Good explanation never listened this type lecture in my carrier😊😊
Day 16 of DSA leaning completed✅🙌
thanks bhaiya it is amazing lecture lot of small small concept i learned 😇😇😇
Really amazing teaching i never say like you i am very lucky to come your channel ❤️
All Concepts are well explained
Really it's amazing explanation 💯
Thank you kunal .....