Methods
in Java
What and Why?
baar baar Karna hai Kuch -
Loops
Built-In Methods
>
-
Math floor(n)
↓ - E3 8]
.
-
GIF 3 7
.
-
·
- 3
[x] -
1
Oz -
2 -
-
Lad · 1 .
2
--2
-
--3
- · -
3 S
.
--
y
HW Find the of 4 numbers.
max
Input them.
- -
Built-In Methods
a , b, c, d
Syntax and a basic void function
I
Output
-
powerbank
Y
s Router re
eiye ·
Roshan
63 ↑
Ashirwad
I
3
*
7
main method runs
first
Syntax and a basic void function
6 Output
I
-
7 ~
11
·
Ajay
12 ↑
YASHIKA
I
~
·
Khushi
2
14
S
9
10
3
Y
S S
13
Understanding method Calls
Method Arguments
return type
static int fun(inta intb doublec I
public , ,
...
3
jo bui andar hai vo chaldo
-
hai
function be do kaam note
>
- ek value bhiho sakti hai
return type
I
Output
-
bann
Fa
~
- S
-
E
~ - 5
Math.max(a . b) >
- int
Ques: Take ‘n’ and ‘r’ as input and print
nCr and nPr.
- #XEXSX3X2
"G For En : C
-= =
=
=
3 ! x (7-3)! 31x4! 3X2
****
~? x(n r)!
-
= 35
"Pr =
!
(H -2) !
Ques: Take two numbers input and
calculate their HCF or GCD.
L
Recursion me
Karenge
Pass by Value & Pass by Reference
I
Output
-
66
~
W
-
~
⑧ 6
-
Ques: Swap 2 Numbers
THANKYOU
Cuties