Here is one trick:
public static int getItself(int itself, int dummy)
{
return itself;
}
public static void main(String[] args)
{
int a = 10;
int b = 20;
a = getItself(b, b = a);
}
More Related Contents:
- How to change letters to other letters Java [closed]
- Java method to swap primitives
- Efficient swapping of elements of an array in Java
- Why is this statement not working in java x ^= y ^= x ^= y;
- Is it possible to write swap method in Java? [duplicate]
- error: incompatible types: ‘Something’ cannot convert to ‘Something’
- When is the finalize() method called in Java?
- How to clear the console?
- Best way to compare 2 XML documents in Java
- How do I use SwingWorker in Java?
- JAX-RS / Jersey how to customize error handling?
- How to test void method with Junit testing tools?
- How to use YamlPropertiesFactoryBean to load YAML files using Spring Framework 4.1?
- How do you enable anti aliasing in arbitrary Java apps?
- Mapping list in Yaml to list of objects in Spring Boot
- Java8 Lambdas and Exceptions
- Slight confusion regarding overriding where variables are concerned
- Spring Security with roles and permissions
- Why am I getting “must be caught or declared to be thrown” on my program?
- How to package resources in Jar properly
- Converting PDF to multipage tiff (Group 4)
- Find the size of the file inside a GZIP file
- Android keystore stopped working
- Why are interfaces preferred to abstract classes?
- Pattern for lazy thread-safe singleton instantiation in java
- Make column read-only using apache poi
- ternary operator not working
- How to Set Focus on JTextField?
- Clear console screen in Java [duplicate]
- Download file from HTTPS server using Java [duplicate]