英文:
New instances created, but symbol cant be found error persists
问题
我有2个Java类,分别是Client.java和RC4.java,在命令行中编译代码时,我收到以下错误信息:
Client.java:50: 错误: 找不到符号
RC4 rc4 = new RC4(hashed_password.getBytes());
尽管我已经在Client.java中创建了RC4的实例,但我不明白为什么这个错误仍然存在。供参考,以下是我的代码片段:
Client.java
public class Client
{ ...
RC4 rc4 = new RC4(hashed_password.getBytes());
...}
RC4.java
public class RC4
{...
public RC4 (byte[] key)
{...}
}
请考虑我是Java初学者,所以请不要使用过多的技术术语,谢谢。
英文:
I have 2 java classes, Client.java and RC4.java respectively, when compiling the code in cmd, I receive the error:
> Client.java:50: error: cannot find symbol
RC4 rc4 = new RC4(hashed_password.getBytes());
I have already created an instance of RC4 in Client.java though, and that is why I dont understand why this error persists. For reference, these are my code snippets
Client.java
public class Client
{ ...
RC4 rc4 = new RC4(hashed_password.getBytes());
...}
RC4.java
public class RC4
{...
public RC4 (byte[] key)
{...
}
}
Please take into account beginner to java here, so please not too much technical jargons ty
专注分享java语言的经验与见解,让所有开发者获益!
评论