SlideShare a Scribd company logo
1 of 16
Download to read offline
redhung@hung.red
TA-LESSON @ JAVA OOP PROGRAMMING
— METHOD
>_ ECHO `WHOAMI`
Interning at CHT Security Co., Ltd.
CTF Player
Focusing on Reversing, Pwning
Contact: redhung@hung.red
>_ CAT ./OVERVIEW
Static Method &
Non-static Method
Return
Value
Variable &
Out of scope
Lab
0x0
0x1
0x2
0x3
Static Method & Non-static Method
>_ METHODS
Static method 可以不被實例化就使用
Non-static method 必須被實例化(宣告物件)才能使⽤
Well-known static method :
public static void main(String args[])
>_ METHODS
public static void main(String args[])
封裝
等級
靜態
Or
非靜態
回傳
型態
函式名稱
&
參數
>_ METHODS
Return Value
>_ RETURN VALUE
每個Function都會定義他的回傳值
E.g. public static void main(String args[])
就像我們在定義變數的資料型別⼀樣,我們會定義function
的回傳型別,來決定回傳值要得到的資料型別
>_ RETURN VALUE
Variable & Out Of Scope
>_ VARIABLES
變數是有存取範圍的,當超出範圍時就不能被存取
舉個最簡單的例⼦:for 迴圈
for(int i=0 ; i<10 ; i++){System.out.println(i);}
變數 i 在 for 迴圈結束後就不再能夠被存取
另⼀個例⼦:Global Variable & Local Variable
LAB
>_ LAB
1. 請完成兩個Method來讓程式正常執⾏
2. 第⼀個Method回傳值為Void
3. 第⼆個Method回傳值為String
4. Main function第⼀⾏印出9m88,第⼆⾏印出9m88LovesDancing
>_ LAB
THANK YOU!
redhung@hung.red
r3dhun9 @r3dhun9 Philip Chen

More Related Content

What's hot

Js 函数 function学习笔记
Js 函数 function学习笔记Js 函数 function学习笔记
Js 函数 function学习笔记keke302
 
C++中级培训胶片
C++中级培训胶片C++中级培训胶片
C++中级培训胶片ff1
 
改善程序设计技术的50个有效做法
改善程序设计技术的50个有效做法改善程序设计技术的50个有效做法
改善程序设计技术的50个有效做法crasysatan
 
單元測試:Mocha、Chai 和 Sinon
單元測試:Mocha、Chai 和 Sinon單元測試:Mocha、Chai 和 Sinon
單元測試:Mocha、Chai 和 SinonHsin-Hao Tang
 
Java注解详解
Java注解详解Java注解详解
Java注解详解zlzl245437
 
3, operators
3, operators3, operators
3, operatorsted-xu
 
A Brief Introduction to Regular Expression with Python 2.7.3 Standard Library
A Brief Introduction to Regular Expression with Python 2.7.3 Standard LibraryA Brief Introduction to Regular Expression with Python 2.7.3 Standard Library
A Brief Introduction to Regular Expression with Python 2.7.3 Standard LibraryWen Liao
 

What's hot (10)

Js 函数 function学习笔记
Js 函数 function学习笔记Js 函数 function学习笔记
Js 函数 function学习笔记
 
C++中级培训胶片
C++中级培训胶片C++中级培训胶片
C++中级培训胶片
 
改善程序设计技术的50个有效做法
改善程序设计技术的50个有效做法改善程序设计技术的50个有效做法
改善程序设计技术的50个有效做法
 
單元測試:Mocha、Chai 和 Sinon
單元測試:Mocha、Chai 和 Sinon單元測試:Mocha、Chai 和 Sinon
單元測試:Mocha、Chai 和 Sinon
 
sorting
sortingsorting
sorting
 
SCJP ch04
SCJP ch04SCJP ch04
SCJP ch04
 
Java注解详解
Java注解详解Java注解详解
Java注解详解
 
Ch08
Ch08Ch08
Ch08
 
3, operators
3, operators3, operators
3, operators
 
A Brief Introduction to Regular Expression with Python 2.7.3 Standard Library
A Brief Introduction to Regular Expression with Python 2.7.3 Standard LibraryA Brief Introduction to Regular Expression with Python 2.7.3 Standard Library
A Brief Introduction to Regular Expression with Python 2.7.3 Standard Library
 

Similar to TA-java-method-109

第六章 函數與巨集
第六章 函數與巨集第六章 函數與巨集
第六章 函數與巨集shademoon
 
1 C入門教學
1  C入門教學1  C入門教學
1 C入門教學Sita Liu
 
GTest交流与经验总结
GTest交流与经验总结GTest交流与经验总结
GTest交流与经验总结coderzh
 
PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术hoopchina
 
Ecma script edition5-小试
Ecma script edition5-小试Ecma script edition5-小试
Ecma script edition5-小试lydiafly
 
Sql培训 (1)
Sql培训 (1)Sql培训 (1)
Sql培训 (1)jhao niu
 
Java Script 引擎技术
Java Script 引擎技术Java Script 引擎技术
Java Script 引擎技术bigqiang zou
 
Asp.net mvc 培训
Asp.net mvc 培训Asp.net mvc 培训
Asp.net mvc 培训lotusprince
 
Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門吳錫修 (ShyiShiou Wu)
 
cppcheck源码分析
cppcheck源码分析cppcheck源码分析
cppcheck源码分析Wu Liang
 
所谓闭包
所谓闭包所谓闭包
所谓闭包youzitang
 
認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算建興 王
 

Similar to TA-java-method-109 (15)

第六章 函數與巨集
第六章 函數與巨集第六章 函數與巨集
第六章 函數與巨集
 
1 C入門教學
1  C入門教學1  C入門教學
1 C入門教學
 
Java annotation
Java annotationJava annotation
Java annotation
 
GTest交流与经验总结
GTest交流与经验总结GTest交流与经验总结
GTest交流与经验总结
 
Sun java
Sun javaSun java
Sun java
 
PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术PHPUnit + Xdebug 单元测试技术
PHPUnit + Xdebug 单元测试技术
 
Ecma script edition5-小试
Ecma script edition5-小试Ecma script edition5-小试
Ecma script edition5-小试
 
Arduino程式快速入門
Arduino程式快速入門Arduino程式快速入門
Arduino程式快速入門
 
Sql培训 (1)
Sql培训 (1)Sql培训 (1)
Sql培训 (1)
 
Java Script 引擎技术
Java Script 引擎技术Java Script 引擎技术
Java Script 引擎技术
 
Asp.net mvc 培训
Asp.net mvc 培训Asp.net mvc 培训
Asp.net mvc 培训
 
Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門Arduino應用系統設計 - Arduino程式快速入門
Arduino應用系統設計 - Arduino程式快速入門
 
cppcheck源码分析
cppcheck源码分析cppcheck源码分析
cppcheck源码分析
 
所谓闭包
所谓闭包所谓闭包
所谓闭包
 
認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算認識 C++11 新標準及使用 AMP 函式庫作平行運算
認識 C++11 新標準及使用 AMP 函式庫作平行運算
 

More from Redhung @ Nationtal Chung Cheng University, Chiayi, Taiwan.

More from Redhung @ Nationtal Chung Cheng University, Chiayi, Taiwan. (17)

Windows Offender_ Reverse Engineering Windows Defender's Antivirus Emulator
Windows Offender_ Reverse Engineering Windows Defender's Antivirus EmulatorWindows Offender_ Reverse Engineering Windows Defender's Antivirus Emulator
Windows Offender_ Reverse Engineering Windows Defender's Antivirus Emulator
 
AEG_ Automatic Exploit Generation
AEG_ Automatic Exploit GenerationAEG_ Automatic Exploit Generation
AEG_ Automatic Exploit Generation
 
Unleashing MAYHEM On Binary Code
Unleashing MAYHEM On Binary CodeUnleashing MAYHEM On Binary Code
Unleashing MAYHEM On Binary Code
 
Firmadyne
FirmadyneFirmadyne
Firmadyne
 
Fintech Newebpay API using Flask and VueJS
Fintech Newebpay API using Flask and VueJSFintech Newebpay API using Flask and VueJS
Fintech Newebpay API using Flask and VueJS
 
TA Lesson Web-109
TA Lesson Web-109TA Lesson Web-109
TA Lesson Web-109
 
TA Lesson Binary Exploitation (Pwn)
TA Lesson Binary Exploitation (Pwn)TA Lesson Binary Exploitation (Pwn)
TA Lesson Binary Exploitation (Pwn)
 
Java - TA課 - Array
Java - TA課 - ArrayJava - TA課 - Array
Java - TA課 - Array
 
Reverse Engineering - Assembly & Introduction
Reverse Engineering - Assembly & IntroductionReverse Engineering - Assembly & Introduction
Reverse Engineering - Assembly & Introduction
 
Web Introduction
Web IntroductionWeb Introduction
Web Introduction
 
Java - TA課 - Let's Begin
Java - TA課 - Let's BeginJava - TA課 - Let's Begin
Java - TA課 - Let's Begin
 
Java - TA課 - 開發環境
Java - TA課 - 開發環境Java - TA課 - 開發環境
Java - TA課 - 開發環境
 
IoT Penetration Talk
IoT Penetration TalkIoT Penetration Talk
IoT Penetration Talk
 
Introduction to computer network
Introduction to computer networkIntroduction to computer network
Introduction to computer network
 
Assembly Language Redhung ( x86 ) @ TDOH
Assembly Language Redhung ( x86 ) @ TDOHAssembly Language Redhung ( x86 ) @ TDOH
Assembly Language Redhung ( x86 ) @ TDOH
 
TP-Link SR20 Zero-day attack
TP-Link SR20 Zero-day attackTP-Link SR20 Zero-day attack
TP-Link SR20 Zero-day attack
 
滲透測試入門 Penetration test - white hat hacking introduction
 滲透測試入門 Penetration test - white hat hacking introduction 滲透測試入門 Penetration test - white hat hacking introduction
滲透測試入門 Penetration test - white hat hacking introduction
 

TA-java-method-109