+ 1
Explain below code syntax
Object strObj = "string"; // what is this syntax String cStr = (String & CharSequence) strObj;
1 Odpowiedź
- 1
(String & CharSequence) strObj;
tryes to reduce (access to) Object type fields to fields of String and CharSequence,
but because every class types are subclass of Object there is not effect of lost functionality of strObj.
String implements CharSequence, you can write
(String) strObj;
with same effect