जावा स्ट्रिंग source code में क्या मतलब है, वहाँ कुछ स्थानों रहे हैं निम्नलिखित टिप्पणी के साथ कहा:"ऑफसेट या गिनती -1 >>> 1 के करीब हो सकती है।" यह
// Note: offset or count might be near -1>>>1.
निम्न उदाहरण पर विचार करें:
public String(char value[], int offset, int count) {
if (offset < 0) {
throw new StringIndexOutOfBoundsException(offset);
}
if (count < 0) {
throw new StringIndexOutOfBoundsException(count);
}
// Note: offset or count might be near -1>>>1.
if (offset > value.length - count) {
throw new StringIndexOutOfBoundsException(offset + count);
}
this.offset = 0;
this.count = count;
this.value = Arrays.copyOfRange(value, offset, offset+count);
}
हम देख सकते हैं, offset
, value.length
और count
सभी int
हैं, इस प्रकार मान -1, 0, 1, या किसी अन्य पूर्णांक हो सकता है। टिप्पणी में "नज़दीक" और ">>>" का अर्थ क्या है, क्या मुझे यहां कुछ याद आ रही है?
'-1 >>> 1' 'Integer.MAX_VALUE' – soulcheck