+ 1

Explain below code syntax

Object strObj = "string"; // what is this syntax String cStr = (String & CharSequence) strObj;

10th Dec 2019, 11:56 AM
Abhishek Thakur
Abhishek Thakur - avatar
2 ответов
- 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
11th Dec 2019, 1:33 AM
zemiak