做网站和软件有区别吗,洛阳公司做网站,市场调研报告范文3000字,网站设计风格有哪些#x1f308;个人主页: Aileen_0v0 #x1f525;热门专栏: 华为鸿蒙系统学习|计算机网络|数据结构与算法|MySQL| #x1f4ab;个人格言:“没有罗马,那就自己创造罗马~” #mermaid-svg-wyCvaz0EBNwHcwsi {font-family:trebuchet ms,verdana,arial,sans-serif;f…
个人主页: Aileen_0v0 热门专栏: 华为鸿蒙系统学习|计算机网络|数据结构与算法|MySQL| 个人格言:“没有罗马,那就自己创造罗马~” #mermaid-svg-wyCvaz0EBNwHcwsi {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .error-icon{fill:#552222;}#mermaid-svg-wyCvaz0EBNwHcwsi .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-wyCvaz0EBNwHcwsi .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-wyCvaz0EBNwHcwsi .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-wyCvaz0EBNwHcwsi .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-wyCvaz0EBNwHcwsi .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-wyCvaz0EBNwHcwsi .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-wyCvaz0EBNwHcwsi .marker{fill:#333333;stroke:#333333;}#mermaid-svg-wyCvaz0EBNwHcwsi .marker.cross{stroke:#333333;}#mermaid-svg-wyCvaz0EBNwHcwsi svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-wyCvaz0EBNwHcwsi .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .cluster-label text{fill:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .cluster-label span{color:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .label text,#mermaid-svg-wyCvaz0EBNwHcwsi span{fill:#333;color:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .node rect,#mermaid-svg-wyCvaz0EBNwHcwsi .node circle,#mermaid-svg-wyCvaz0EBNwHcwsi .node ellipse,#mermaid-svg-wyCvaz0EBNwHcwsi .node polygon,#mermaid-svg-wyCvaz0EBNwHcwsi .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-wyCvaz0EBNwHcwsi .node .label{text-align:center;}#mermaid-svg-wyCvaz0EBNwHcwsi .node.clickable{cursor:pointer;}#mermaid-svg-wyCvaz0EBNwHcwsi .arrowheadPath{fill:#333333;}#mermaid-svg-wyCvaz0EBNwHcwsi .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-wyCvaz0EBNwHcwsi .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-wyCvaz0EBNwHcwsi .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-wyCvaz0EBNwHcwsi .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-wyCvaz0EBNwHcwsi .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-wyCvaz0EBNwHcwsi .cluster text{fill:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi .cluster span{color:#333;}#mermaid-svg-wyCvaz0EBNwHcwsi div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-wyCvaz0EBNwHcwsi :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} consequent on随之而来 文章目录 实参和形参的关系方法重载EXERCISES1-模拟登录 实参和形参的关系
public class Test {public static void swap(int a , int b){int tmp a;a b;b tmp;
}public static void main(String[] args) {int x 10;int y 20;swap(x,y);System.out.println(x);System.out.println(y);}
}JAVA 当中无法获取到 局部变量的地址.
实参和形参的关系就像榨汁机一样,丢进去的是橙子,出来的是橙汁.
public class Test {public static void main(String[] args) {int[] arr {10,20};swap(arr);System.out.println(arr[0] arr[0] arr[1] arr[1] );}public static void swap(int[] arr) {int tmp arr[0];arr[0] arr[1];arr[1] tmp;}
}虽然数组通过下标可以交换它的位置,但它的内存地址并未发生改变.所以说,数组不能传某一块的内存地址.
return 代表法方的结束.return后的代码不会被执行. 方法重载
public class Test {public static double add(double d , double c){return d c;}// Overload 重载public static int add(int d , int c){return d c;}public static long add(long d , int c){return d c;}public static long add(long d , int c , int b){return d c;}public static void main(String[] args) {int x 10;int y 20;int ret add(x, y);System.out.println(ret);double d1 10.5;double d2 12.5;double dd add(d1, d2);System.out.println(dd);}}根据上面的代码我们可以知道,方法的重载遵循以下原则: (1)方法名一样. (2)方法的参数列表不一样[个数,数据类型,顺序] (3)返回值是否一样,不影响方法重载. ___
EXERCISES1-模拟登录 public class X {public static void main(String[] args) {int count 3;Scanner scanner new Scanner(System.in);while (count ! 0) {System.out.println(请输入您的密码);String password scanner.nextLine();if (password.equals(123456)) {System.out.println(登陆成功);return; // 通过 return退出程序} else {System.out.println(输入错误,请重新登录);count--;}}System.out.println(程序已退出);}
}