lnteger x=23456;SystemoutprintInxtoStringsubstring24;
The output of this code will be "45".
Explanation:
- The variable x is initialized to the integer value 23456.
- The toString() method is called on x, which converts it to a String representation: "23456".
- The substring(2,4) method is called on this String, which returns a new String containing the characters starting at index 2 (inclusive) and ending at index 4 (exclusive): "45".
- Finally, this String is printed to the console using the println() method.
原文地址: https://www.cveoy.top/t/topic/bt1i 著作权归作者所有。请勿转载和采集!