It is because the compiler can check that it ('a' + 10
) is within the bounds of a char whereas it cannot (in general) check that 'a' + <an integer>
is within the bounds.
More Related Contents:
- Currency.getSymbol() returning “US$”
- How to convert jsonString to JSONObject in Java
- Scanner double value – InputMismatchException
- Spring Boot and multiple external configuration files
- How to get the current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in Java?
- @Resource vs @Autowired
- Array of Generic List
- Combining Spring project and Jersey
- Override Java System.currentTimeMillis for testing time sensitive code
- How can I print an image on a Bluetooth printer in Android?
- Unable to resolve host “” No address associated with host name [closed]
- Is there a difference between single and double quotes in Java?
- How do you embed binary data in XML?
- JavaFX WebView grow to fill entire area
- How to get names of classes inside a jar file?
- Pass a local file in to URL in Java
- Adding points to XYSeries dynamically with JfreeChart
- How to inject module declaration into JAR?
- Is Java really slow?
- How do I assert an Iterable contains elements with a certain property?
- Printing reverse of any String without using any predefined function?
- Why does HashMap require that the initial capacity be a power of two?
- What is the difference between a lambda and a method reference at a runtime level?
- Put external library to the JAR? [closed]
- Wrapping a ByteBuffer with an InputStream
- Verify if String is hexadecimal
- Eclipse RCP: Actions VS Commands
- Given a Java InputStream, how can I determine the current offset in the stream?
- Why should we declare an interface inside a class?
- How to use the same C++ code for Android and iOS?