#24 Methods in Java

  Рет қаралды 233,085

Telusko

Telusko

Күн бұрын

Check out our courses:
Complete Java Developer Course Batch-3: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
website : courses.telusk...
In this lecture we will learn:
Method in Java
Use of methods in Java
Main method in Java
return type in methods
Syntax of method
#1
A method in Java or Java Method is a collection of statements that perform some specific task and return the result to the caller.
Methods in Java allow us to reuse the code without retyping code.
In Java, we create the components with the help of classes.
Every class has a behavior and it is defined through the method.
Behaviour or method is defined with the round brackets ().
For every method, we also have to specify the type of access to it.
Method does some tasks and it also returns something.
We can call methods by creating an object.
We can pass also pass values in a method.
We can also put conditions inside the method like with the help of if..else.
return keyword stops the execution of a method as it does not execute the further statements after it.
#2
-- void is used when we do not want a method to return something.
-- String is used to return a string value.
-- int is used to return an integer value.
Main method is the start of execution from where the program begins.
#3
The syntax for method:-
class Computer
{
public void playMusic()
{
System.out.println("Music Playing..");
}
}
Github repo : github.com/nav...
Java:- bit.ly/JavaUde...
Spring:- bit.ly/SpringU...
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com

Пікірлер: 46
@christyaldridge3839
@christyaldridge3839 5 ай бұрын
I have never really understood the concept of Class, Methods and Object until i watched this video... you really broke it down brother...Excellent instructions
@abhishekmitra9712
@abhishekmitra9712 Жыл бұрын
Watching this video today and realized that your joke about "Nothing phone" actually became true. There is actually something called nothing phone.😄
@smittt20
@smittt20 Ай бұрын
The kind of details in the video like explaining every single word from void to object to function helped me a lot, i have never understood class and object effectively until now. Thanks a lot sir
@Sorjen108
@Sorjen108 Жыл бұрын
Nothing phone 🤣 Thanks for those great updated videos! Much love from Mauritius
@burpeesquad
@burpeesquad Жыл бұрын
The "Nothing" joke hits hard. haha loved it 😂
@mango-strawberry
@mango-strawberry Жыл бұрын
Your explanation is extremely good
@Tanned_guy
@Tanned_guy Жыл бұрын
Excellent teaching.
@sidharthansidhu4783
@sidharthansidhu4783 11 ай бұрын
It is weird how a Computer returns a pen😄. Excellent teaching 😍
@Lwa-fq5yz
@Lwa-fq5yz 2 ай бұрын
🤣
@heycreatives
@heycreatives Жыл бұрын
Way of explain its really good.even don't know java also easy to understand...
@melwinsanthosh8135
@melwinsanthosh8135 Жыл бұрын
You are teaching very well than my teachers
@Logilogii
@Logilogii 20 күн бұрын
Great full ❤
@NoName-im9rp
@NoName-im9rp Жыл бұрын
awesome sir keep it up
@wesjales5578
@wesjales5578 6 ай бұрын
Why are youtube videos literally alway better then in person lectures?
@Gunasekhar-zj6eh
@Gunasekhar-zj6eh 2 ай бұрын
what is the environment you are using?
@AriRam-xs7ie
@AriRam-xs7ie 10 ай бұрын
Can you please explain about the ' . ' (Dot)operater and it's function
@yashaswinihm4288
@yashaswinihm4288 9 ай бұрын
It's basically used as a accessing operator. General used with object to access the data variables and methods
@Marshal-y2y
@Marshal-y2y Ай бұрын
Will you please explain why this playlist is not a continuous one ,like when i watch video number 23 and go to 24 ....you were actually saying that in previous video we have seen something like calculator program which doesn't exists in the previous whichever i watched
@md.ikramulislam9708
@md.ikramulislam9708 28 күн бұрын
yeah the numbering is wrong sometimes ,that was in #22
@RishiKBose-25
@RishiKBose-25 8 ай бұрын
Sir, it would be advisable to update your IDE promptly.
@debo8234
@debo8234 9 ай бұрын
poetic
@juturtaur298
@juturtaur298 Жыл бұрын
Thank you sir
@asuradevan1702
@asuradevan1702 11 ай бұрын
Well Teached
@DarkyBoy-n1i
@DarkyBoy-n1i 2 ай бұрын
But you teach well and I've never seen a teacher like you.
@sahanbandaranayake708
@sahanbandaranayake708 Жыл бұрын
great explanation 😍
@iamgold743
@iamgold743 4 ай бұрын
bro but compiler show : you shoud declare main method in computer class
@jb6652
@jb6652 6 ай бұрын
how do you make the terminal on right side like that?
@PoojaChindarkar-u9e
@PoojaChindarkar-u9e 10 ай бұрын
its nice to get a nothing phone at 2 rupees!!
@everyone3602
@everyone3602 Жыл бұрын
dr's of java
@czarscrib3680
@czarscrib3680 4 ай бұрын
I knew about the nothing phone but I wasn't expecting that joke😅😅😅😅
@JehanSaren
@JehanSaren Жыл бұрын
Hi Sir, please help🙏, how to access the variables inside the method to another method? Void Room1(){ name1="Elisa"; name2="Jefrey"; } Void Room2(){ i want to access "Elisa" }
@droste07
@droste07 11 ай бұрын
Then you have to create instance variable (variable inside the class) then you can access it anywhere in the class block!
@DarkyBoy-n1i
@DarkyBoy-n1i 2 ай бұрын
Sir, Who returns nothing?🤣🤣🤣🤣
@pratiktiwariramji
@pratiktiwariramji 2 ай бұрын
Exams 😂🤣
@ozodbekhamidov987
@ozodbekhamidov987 Жыл бұрын
good exam
@hozsumosa9322
@hozsumosa9322 Жыл бұрын
What poor jokes, poor + funny jokes 😁 9:52
@AnuragRawat01
@AnuragRawat01 Жыл бұрын
9:45 Let's put Joke aside but you need to focus at learning Joke unlike this one 😅😅
@hareeshbhat2571
@hareeshbhat2571 7 ай бұрын
i didnt get laugh because of nothing but at last sir said ignore my poor jokes🤣🤣🤣
@rkrk5378
@rkrk5378 10 ай бұрын
One SUGESSTION Sir, Please don't give different 2 examples, Please stick to one example through out the video.. if you are giving example of 'Computer' then please stick to that example only Instead of giving several examples like Car, Pen, Computer etc this could confuse a viewer.. OTHERWISE THE VIDEO WAS GOOD
@singasong7679
@singasong7679 Жыл бұрын
method inside method give error. please correct this anyone ij() in k() method show error class A{ int i; int j; void ij(){ System.out.println("i and j"+i+ " "+j); } int show(){ return i+j; } class B extends A{ int k; void k(){ System.out.println("value of k"+k); ij(); } int sumijk(){ return show()+k; } public static void main(String[] args) { B obj =new B(); obj.i=44; obj.j=33; obj.k=21; int c=obj.sumijk(); System.out.println("value of sum"+c); } } }
@vanajakshibc4587
@vanajakshibc4587 6 ай бұрын
U have pass values to the methods which does calculation and returns values
@rawcore
@rawcore 2 ай бұрын
09:50 Sponsored by Nothing huh 😂 .
@ahmedmoussa7519
@ahmedmoussa7519 7 ай бұрын
Nothing Phone
@bantaigamer7123
@bantaigamer7123 6 ай бұрын
sir pls hindi me bataiye
@md.ikramulislam9708
@md.ikramulislam9708 28 күн бұрын
go to code with harry
@GurijalaSudhakarrao
@GurijalaSudhakarrao 2 ай бұрын
Super anna
#25 Method Overloading in Java
6:03
Telusko
Рет қаралды 207 М.
#26 Stack And Heap in Java
12:37
Telusko
Рет қаралды 256 М.
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 11 МЛН
Inside Out 2: ENVY & DISGUST STOLE JOY's DRINKS!!
00:32
AnythingAlexia
Рет қаралды 13 МЛН
#22 Class and Object Practical in Java
15:36
Telusko
Рет қаралды 250 М.
Array Methods in JavaScript | 17 Useful Methods
42:39
DoableDanny
Рет қаралды 57 М.
Java methods 📞
11:05
Bro Code
Рет қаралды 136 М.
Stream API in Java
26:04
Telusko
Рет қаралды 333 М.
Learn Java in One Video - 15-minute Crash Course
14:54
Coding with John
Рет қаралды 728 М.
Coding Was Hard Until I Learned THESE 5 Things!
7:40
Pooja Dutt
Рет қаралды 1 МЛН
#51 This and Super Method in Java
12:11
Telusko
Рет қаралды 112 М.
#53 Packages in Java
12:20
Telusko
Рет қаралды 198 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1,1 МЛН
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26