1~

Minter Coder's Blog

Chapter 2 - Soru 6

2021-03-17

6. How many of the following methods compile?
public String convert(int value) {
return value.toString();

}
public String convert(Integer value) {
return value.toString();
}
public String convert(Object value) {
return value.toString();
}
A. None
B. One
C. Two
D. Three

Kaç tane method derlenir diyo ? 2 adet çünkü primitive türlerde methodlar yoktur yani siz Integer classının içerisindeki toString methodunu çağırabilirsiniz ama int primitve typeında böyle bir şey yoktur.