windows tftp客户端使用方法 您所在的位置:网站首页 windowstftp服务器 windows tftp客户端使用方法

windows tftp客户端使用方法

2023-08-19 10:10| 来源: 网络整理| 查看: 265

JAVA基础篇之枚举

jackfreesiue: 用法二:switch JDK1.6之前的switch语句只支持int,char,enum类型,使用枚举,能让我们的代码可读性更强。 Java代码 enum Signal { GREEN, YELLOW, RED } public class TrafficLight { Signal color = Signal.RED; public void change() { switch (color) { case RED: color = Signal.GREEN; break ; case YELLOW: color = Signal.RED; break ; case GREEN: color = Signal.YELLOW; break ; } } }

JAVA基础篇之枚举

jackfreesiue: 用法三:向枚举中添加新方法 如果打算自定义自己的方法,那么必须在enum实例序列的最后添加一个分号。而且 Java 要求必须先定义 enum 实例。

JAVA基础篇之枚举

jackfreesiue: Java代码 public enum Color { RED("红色" , 1 ), GREEN( "绿色" , 2 ), BLANK( "白色" , 3 ), YELLO( "黄色" , 4 ); // 成员变量 private String name; private int index; // 构造方法 private Color(String name, int index) { this .name = name; this .index = index; } // 普通方法 public static String getName( int index) { for (Color c : Color.values()) { if (c.getIndex() == index) { return c.name; } } return null ; } public String getName() { return name; } public void setName(String name) { this .name = name; } public int getIndex() { return index; } public void setIndex( int index) { this .index = index; } }

JAVA基础篇之枚举

jackfreesiue: 用法四:覆盖枚举的方法 下面给出一个toString()方法覆盖的例子。 Java代码 public enum Color { RED("红色" , 1 ), GREEN( "绿色" , 2 ), BLANK( "白色" , 3 ), YELLO( "黄色" , 4 ); // 成员变量 private String name; private int index; // 构造方法 private Color(String name, int index) { this .name = name; this .index = index; } //覆盖方法 @Override public String toString() { return this .index+ "_" + this .name; } }

windows tftp客户端使用方法

jackfreesiue: 假如我们需要确定谁占用了我们的9050端口 1、Windows平台 在windows命令行窗口下执行: C:/>netstat -aon|findstr "9050" TCP 127.0.0.1:9050 0.0.0.0:0 LISTENING 2016 看到了吗,端口被进程号为2016的进程占用,继续执行下面命令: C:/>tasklist|findstr "2016" tor.exe 2016 Console 0 16,064 K 很清楚吧,tor占用了你的端口



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有