我有以下代码:
import tensorflow as tf
print("Hello")
Run Code Online (Sandbox Code Playgroud)
输出是:
This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
Hello # This is printed about 5 seconds after the message
Run Code Online (Sandbox Code Playgroud)
我有这个代码:
class A {
public void func(String str, List<String> lst) {}
}
class B extends A {
public void func(String str, List<Integer> lst) {} // Does not compile
}
Run Code Online (Sandbox Code Playgroud)
带注释的行不会使用以下解释进行编译:“两种方法具有相同的擦除功能,但都不会覆盖另一个方法”。一方面,我知道它不是最重要的,因为第二个参数中的泛型类型是不同的。另一方面,在擦除之后,两个函数基本上具有相同的签名,因此它也不会重载。但我很难理解为什么它不能编译。任何帮助,将不胜感激。
添加:即使我将签名更改为
public Object func(String str, List<Integer> lst) {return null;}
Run Code Online (Sandbox Code Playgroud)
出于同样的原因,它仍然无法编译。现在这些完全是不同的签名,所以这让我更加困惑。