#24 Methods in Java

preview_player
Показать описание
Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Udemy Courses:

For More Queries WhatsApp or Call on : +919008963671

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()
{
}
}

More Learning :

Donation:
PayPal Id : navinreddy20
Рекомендации по теме
Комментарии
Автор

Watching this video today and realized that your joke about "Nothing phone" actually became true. There is actually something called nothing phone.😄

abhishekmitra
Автор

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

christyaldridge
Автор

The "Nothing" joke hits hard. haha loved it
😂

burpeesquad
Автор

Way of explain its really good.even don't know java also easy to understand...

heycreatives
Автор

You are teaching very well than my teachers

melwinsanthosh
Автор

It is weird how a Computer returns a pen😄. Excellent teaching 😍

sidharthansidhu
Автор

Nothing phone 🤣
Thanks for those great updated videos!
Much love from Mauritius

Sorjen
Автор

how do you make the terminal on right side like that?

jb
Автор

what is the environment you are using?

Gunasekhar-zjeh
Автор

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"

}

pxpjuxk
Автор

Can you please explain about the ' . ' (Dot)operater and it's function

AriRam-xsie
Автор

Sir, it would be advisable to update your IDE promptly.

RishiBose-
Автор

Why are youtube videos literally alway better then in person lectures?

wesjales
Автор

But you teach well and I've never seen a teacher like you.

DarkyBoy-ni
Автор

its nice to get a nothing phone at 2 rupees!!

mxenjfv
Автор

I knew about the nothing phone but I wasn't expecting that joke😅😅😅😅

czarscrib
Автор

9:45
Let's put Joke aside but you need to focus at learning Joke unlike this one 😅😅

AnuragRawat
Автор

What poor jokes, poor + funny jokes 😁 9:52

hozsumosa
Автор

i didnt get laugh because of nothing but at last sir said ignore my poor jokes🤣🤣🤣

hareeshbhat
Автор

bro but compiler show : you shoud declare main method in computer class

iamgold