2024-06-28 20:47:48 发布
网友
我对java和python都是新手。我不知道如何在java函数中传递图像文件。对于python,我使用self。下面是我的python代码
img.py
def initialize(self, img1, img2): self.imgDiff = 1 self.img1 = img1 self.img2 = img2
如何在Java上实现这一点
在Java中,不需要self作为参数。另外,对于其他self,将它们替换为this
self
this
像这样:
void initialize(Image img1, Image img2) { this.img1 = img1; this.img2 = img2; }
当然,这取决于图像的类型
在Java中,不需要
self
作为参数。另外,对于其他self
,将它们替换为this
像这样:
当然,这取决于图像的类型
相关问题 更多 >
编程相关推荐