Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even more answers and better formatting #38

Merged
merged 15 commits into from
Aug 8, 2017
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
Ifhay committed Aug 7, 2017
commit 48d9d57cbff7ceddaacb6fb62d7dbcbd2b737b85
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ It is also a good practice to annotate overridden methods with `@Override` to ma
* What is the difference between an Integer and int?
- `int` is a primitive data type (with `boolean`, `byte`, `char`, `short`, `long`, `float` and `double`), while `Integer` (with `Boolean`, `Byte`, `Character`, `Short`,`Long`, `Float` and `Double`) is a [wrapper](https://docs.oracle.com/javase/tutorial/java/data/numberclasses.html) class that encapsulates primitive data type, while providing useful methods to perform different tasks with it.
* Do objects get passed by reference or value in Java? Elaborate on that.
- In Java all primitives and objects are passed by reference, meaning that their copy will be manipulated in receiving method. But there is a caveat - when you pass an object reference into a method, a *copy of this reference* is made, so it still points to the same object. This means, that any changes that you make to the insides of this object are retained, when the method exits.
- In Java all primitives and objects are passed by value, meaning that their copy will be manipulated in the receiving method. But there is a caveat - when you pass an object reference into a method, a *copy of this reference* is made, so it still points to the same object. This means, that any changes that you make to the insides of this object are retained, when the method exits.
```java
public class Pointer {

Expand Down