default的用法
用于Switch语句
default可以用于Switch语句, 用于在case匹配不到值的时候给予其默认值
int day = 8;
String dayString;
switch (day) {
case 1: dayString = "Monday";
break;
case 2: dayString = "Tuesday";
break;
case 3: dayString = "Wednesday";
break;
case 4: dayString = "Thursday";
break;
case 5: dayString = "Friday";
break;
case 6: dayString = "Saturday";
break;
default: dayString = "Sunday";
break;
}
用于interface
想要在接口中实现具体方法, 需要用default来修饰方法
public interface InterfaceDemo {
default void showDefault(){
System.out.println("this is showDefault method");
}
static void showStatic(){
System.out.println("this is showStatic method");
}
void sayHi();
}
explain
explain可以查看sql的执行计划, 方便索引优化 当索引及其复杂的时候, MySQL有可能会选错索引, 所以就需通过explain来查看并根据其结果做出修改
explain select id from test_table1;
端口对外开放
netstat -plunt
/sbin/iptables -I INPUT -p tcp --dport 26000 -j ACCEPT
|