当前位置:网站首页>[calling method]
[calling method]
2022-04-22 07:41:00 【Vi---Rum】
How to call methods between two classes
Create a class , And write method
public class Demo02{
/** * Calculate two int The sum of type integers * @param a Addition number * @param b Augend * @return a + b And */
public static int mySum(int a, int b){
return a + b;
}
}
Create another class , Call the method just written
public class Demo02Test {
public static void main(String[] args) {
int sum = Demo02.mySum(10, 20);
System.out.println(sum);
}
}
// Output results
30
版权声明
本文为[Vi---Rum]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220618400708.html
边栏推荐
- 换根dp(啊啊啊啊啊)
- Pointer structure const summary
- Links summary qwq
- Drive communication with R3
- 中断门&陷阱门
- Definition and difference between rewriting and overloading
- In depth understanding of MySQL (5): talk about MySQL lock algorithm in detail
- 838 · the sum of subarrays is K
- Kotlin学习一、作用域函数let、with、run、apply、also
- 278 · draw fill
猜你喜欢
随机推荐
Kotlin learning 1. Scope functions let, with, run, apply, also
Codeforces Round #623
Codeforces Round #776 (Div. 3)
APC(一)
Educational Codeforces Round 125 (Rated for Div. 2)
H. Happy number (binary conversion / nth special number) (2021 Niuke summer multi school training camp 9)
323 · string game
The art of concurrent programming (11): introduction to tool classes in JUC
Kotlin 协程Flow、StateFlow、ShareFlow
UNICODE_STRING
437. Path sum III
Ffmpeg Command (vi), video extraction audio video
B. Ball dropping (simple geometric calculation / similar triangle) (2021 Niuke summer multi school training camp 1)
System log collection series
Like fuzzy query of Android room database
867 · four key keyboard
APC (IV)
Redis的设计与实现(6):Redis如何实现高可用
Pointer structure const summary
SUCTF 2019 EasySQL









