Home > Back-end >  JAVA the exchange of two variables, a static method
JAVA the exchange of two variables, a static method

Time:09-25

Create the class, the class to invoke the variables

CodePudding user response:

Java method parameters only value transfer, there is no pointer and a reference type, so use method direct exchange of two variables is can't do,
If use indirect way, you can use array, collection, or the two variables are encapsulated into a class or interface
  • Related