新实例已创建,但仍然存在找不到符号的错误。

huangapple 未分类评论59阅读模式
英文:

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

Added in cmd:
新实例已创建,但仍然存在找不到符号的错误。

huangapple
  • 本文由 发表于 2020年7月27日 20:19:34
  • 转载请务必保留本文链接:https://java.coder-hub.com/63115204.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定