1 Replies - 163 Views - Last Post: 02 April 2015 - 06:18 AM Rate Topic: -----

#1 shivampaw  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 67
  • Joined: 13-March 14

java returning variable back to original class

Posted 02 April 2015 - 02:08 AM

Hi,

I have a file called Client.java and another file called Crypt.java

In client.java I have the following code that sends 2 byte arrays that are xor'd in Crypt.java

After the XOR is done in Crypt.java I need to get the variable "val" that is defined in the Crypt class back into the main run function of the Client class.

How would I achieve that?

Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: java returning variable back to original class

#2 g00se  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2935
  • View blog
  • Posts: 12,565
  • Joined: 20-September 08

Re: java returning variable back to original class

Posted 02 April 2015 - 06:18 AM

You shouldn't need a variable. The Crypt class is a utility class, so it should have return the ciphertext in a static method resulting in something like the following utility method call


byte[] ciphertext = Crypt.crypt(array1, array2);

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1