在Eclipse中,当我输入main ctr+时space,它会static void main为我生成一个方法.当我输入methodName ctr+时space,智能代码完成将建议生成名为的方法methodName.
如何在IntelliJ中自动生成void方法?
有一个像这样的json:
{
"P1": "ss",
"Id": 1234,
"P2": {
"P1": "cccc"
},
"P3": [
{
"P1": "aaa"
}
]
}
Run Code Online (Sandbox Code Playgroud)
P1如果没有迭代所有json,我怎么能找到所有的价值?
PS:P1可以在json的任何地方.
如果没有方法可以做到这一点,你能告诉我如何遍历json吗?
可能重复:
java
中的守护程序线程什么时候守护程序线程有用吗?
我对Java中用户线程和守护程序线程之间的区别感到困惑.
你能告诉我吗:
我怎么能print a log在VCL?
我可以在屏幕上打印日志信息吗?
我可以这样做吗?
sub vcl_recv {
....
log.info(req.http.host); // can i write a log here?
....
}
Run Code Online (Sandbox Code Playgroud) 我正在使用GIT,我正在同时处理两项任务.任务1和任务2.现在我想推送到服务器Task1.所以我将任务1(T1)的所有相关文件提交到临时区域.
我的Staging区域已准备好推送到服务器,但在此之前,我认为检查我的暂存区域是否正在编译并通过测试是安全的.
如何在暂存区域获得工作目录only changes in order to compile it并运行自动化测试?
注意我不想运行工作目录的测试,只有暂存区域...因为工作目录有与T1和T2相关的变化.
我的清漆版本是3.0.
当我卷曲URL时,我的服务器运行良好,但是当使用varnish cache时,它503 service unavailable会偶尔返回.
日志信息喜欢的是:
0 Debug - "VCL_error(200, OK)"
24 VCL_call c recv error
24 VCL_call c error deliver
24 SessionClose c error
0 Debug - "VCL_error(200, OK)"
27 VCL_call c recv error
27 VCL_call c error deliver
27 SessionClose c error
0 Debug - "VCL_error(200, OK)"
16 VCL_call c recv error
16 VCL_call c error deliver
16 SessionClose c error
14 Debug - "Write error, retval = 2998272, len = 8465870, errno = …Run Code Online (Sandbox Code Playgroud) 我想要像轮胎一样的轮胎地图:
Map<String,Object> map = new TireMap();
map.put("com","1");
map.put("com.aa","2");
map.put("com.aa.bb","3");
map.get("com");// return ["1","2","3"]
map.get("com.a"); //return ["2","3"]
map.get("com.aa"); //return ["2","3"]
// the key maybe full key or just key prefix
Run Code Online (Sandbox Code Playgroud)
如何实现这样的地图?或者是否已经在Java API或开源中退出了地图?
它非常像innodb在mysql中.
PS: Performance非常重要.存储物品将超过1000W.
我从Java内部类和静态嵌套类中了解内部类和嵌套类
但是任何人都可以告诉我Inner.redo1()和Inner.redo2()之间的区别是什么?
或者Inner.print1()和Inner.print2()是一样的吗?
public class Outer {
private String str = "outer";
public void print() {
System.out.println("a");
}
public class Inner {
public void redo1() {
print();
}
public void redo2() {
Outer.this.print();
}
}
}
Run Code Online (Sandbox Code Playgroud)
PS:在java.util.ArrayList.Itr #remove中
public void remove() {
if (lastRet < 0)
throw new IllegalStateException();
checkForComodification();
try {
ArrayList.this.remove(lastRet);
cursor = lastRet;
lastRet = -1;
expectedModCount = modCount;
} catch (IndexOutOfBoundsException ex) {
throw new ConcurrentModificationException();
}
}
Run Code Online (Sandbox Code Playgroud)
它为什么使用ArrayList.this.remove(lastRet);但不是remove(lastRet); …
class SomeClass1 {
void method1() { }
public void method2() { }
private void method3() { }
protected void method4() { }
}
class DemoClass{
public static void main(String[] parameters) {
SomeClass1 sc = new SomeClass1();
sc.method1();
sc.method2();
sc.method4();
}
}
Run Code Online (Sandbox Code Playgroud)
受保护的方法只能由继承超类的类访问.正如我们在这里看到的,DemoClass不会扩展SomeClass.但是,它能够访问受保护的方法.这怎么可能?
java ×4
varnish ×2
varnish-vcl ×2
b-tree ×1
caching ×1
git ×1
ide ×1
json ×1
jvm ×1
map ×1
nested-class ×1
performance ×1
python ×1
search ×1
tire ×1