当前位置:网站首页>Connect to blog method, overload, recursion
Connect to blog method, overload, recursion
2022-07-07 12:35:00 【Xiaobai shelter】
1. In and out
Enter the reference : Do it Unknown condition required
The ginseng : Feedback needed after completion
2. Method overloading (overload)
Definition : Same method name , Different parameter list . The list is divided into : Different numbers and types
The method is unique : Method name and parameters
3. Memory division :
Java Runtime Data Area : java Runtime area , General name JVM Memory
*
- Program counter :
A small area of memory . Action can be seen as a position indicator of the current program execution
- Static zone / Method area :
Save program files (class file ) And static data , Before the method is called , Also stored in the static area , There is also a runtime constant pool inside
- VM Stack : Also called stack memory
Stack memory is a space opened up based on stack data structure , The feature is first in and last out
Stack : It's a data structure , First in, then out , Like a clip
- The components of the stack
Stack space : Stack memory is stack space
Stack frame : Every stack element in the stack space It's called stack frame ( such as Every bullet in the magazine It's called stack frame )
Stack bottom element : The first stack frame put in
Top element of stack : The last stack frame put in
- Stack operation
Pressing stack : It refers to the process of putting elements into stack space
Bomb stack : Is the process of ejecting elements
- Stack memory , Is used to execute methods , Execution of all methods , Must be done in stack memory
- Native Method Stack :
Used to execute some local methods , such as hashCode etc. , The model and operation are similar to VM Stack consistency , Never mind ,
- Heap memory :
To save objects
4. recursive
Definition : Method calls the current method
recursive thinking : a. Recursion and iteration are equivalent It's a cycle b. The basic idea is to analogy in turn
Application scenarios : What a cycle can do , Recursion can do , But in this case, it is preferred to use loops , Recursion should be very memory consuming , Low operating efficiency ; however Like tree structure , You can't do a loop , It can only be done by handing it back
Common recursive application scenarios : So the tree structure ; Folder copy ; Fibonacci sequence
difficulty : It's not easy to understand recursion , drawing , Stack frame call graph
Be careful : There must be termination conditions , Otherwise, it will be like an endless cycle , As a result, the stack memory overflow problem occurs when you keep pressing the stack without bouncing the stack
5. Fibonacci sequence : It means that from the third item, each item is the sum of the first two items namely f(n)=f(n-1)+f(n-2) (n>2)
边栏推荐
- 《看完就懂系列》天哪!搞懂节流与防抖竟简单如斯~
- Several methods of checking JS to judge empty objects
- Unity map auto match material tool map auto add to shader tool shader match map tool map made by substance painter auto match shader tool
- Static vxlan configuration
- Preorder, inorder and postorder traversal of binary tree
- Utiliser la pile pour convertir le binaire en décimal
- Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
- Cenos openssh upgrade to version 8.4
- SQL Lab (36~40) includes stack injection, MySQL_ real_ escape_ The difference between string and addslashes (continuous update after)
- 数据库系统原理与应用教程(011)—— 关系数据库
猜你喜欢
On valuation model (II): PE index II - PE band
leetcode刷题:二叉树24(二叉树的最近公共祖先)
Tutorial on principles and applications of database system (010) -- exercises of conceptual model and data model
"Series after reading" my God! It's so simple to understand throttling and anti shake~
SQL lab 21~25 summary (subsequent continuous update) (including secondary injection explanation)
ps链接图层的使用方法和快捷键,ps图层链接怎么做的
leetcode刷题:二叉树25(二叉搜索树的最近公共祖先)
Solutions to cross domain problems
【PyTorch实战】用PyTorch实现基于神经网络的图像风格迁移
Configure an encrypted web server
随机推荐
【统计学习方法】学习笔记——支持向量机(下)
leetcode刷题:二叉树24(二叉树的最近公共祖先)
免备案服务器会影响网站排名和权重吗?
[play RT thread] RT thread Studio - key control motor forward and reverse rotation, buzzer
数据库安全的重要性
Hi3516 full system type burning tutorial
ENSP MPLS layer 3 dedicated line
SQL Lab (32~35) contains the principle understanding and precautions of wide byte injection (continuously updated later)
Sign up now | oar hacker marathon phase III midsummer debut, waiting for you to challenge
Airserver automatically receives multi screen projection or cross device projection
How much does it cost to develop a small program mall?
Using stack to convert binary to decimal
Is it safe to open an account in Ping An Securities mobile bank?
【PyTorch实战】用PyTorch实现基于神经网络的图像风格迁移
2022危险化学品生产单位安全生产管理人员考题及在线模拟考试
TypeScript 接口继承
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
牛客网刷题网址
IPv6 experiment
Static routing assignment of network reachable and telent connections