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
Негізгі бет #24 Methods in Java
Пікірлер: 46