부트캠프 기록/Section1

[Java] 심화(Effective) 문제풀이/ 18일차 기록 미완

bbangduck 2022. 9. 18. 22:18

1. incompatible types: OptionalInt cannot be converted to Integer

 

https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html

 

Integer (Java Platform SE 7 )

Returns the value obtained by rotating the two's complement binary representation of the specified int value right by the specified number of bits. (Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.) Note that right

docs.oracle.com

https://docs.oracle.com/javase/8/docs/api/java/util/OptionalInt.html

 

OptionalInt (Java Platform SE 8 )

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that

docs.oracle.com

https://stackoverflow.com/questions/33190768/optionalint-vs-optionalinteger

 

OptionalInt vs Optional<Integer>

When scrolling through the documentation for the java.util package, I was surpised to find that Optional<T> and OptionalInt have no relationship to each other. This seems very hard to belive,...

stackoverflow.com

 

 

2. 0과 null의 차이