About 150,000 results
Open links in new tab
  1. How do I use the character's equals () method in Java?

    Sep 1, 2018 · For example, primitive type int represents integers using 32 bits. All variables of type int use 32 bits. There are only eight primitive data types in Java: byte, short, int, long, …

  2. Java: Checking contents of char variable with if condition

    May 9, 2010 · How to correctly write if statement parsing a string to char, java Hot Network Questions Is there a nuanced difference between “intransigent,” “obstinate,” and “unyielding”?

  3. java - Take a char input from the Scanner - Stack Overflow

    Dec 19, 2012 · There are three ways to approach this problem: Call next() on the Scanner, and extract the first character of the String (e.g. charAt(0)) If you want to read the rest of the line as …

  4. JAVA - logical operations on chars - Stack Overflow

    I am creating a file reading program. I need to filter out any char that is not '0-9' or '.'. Any char other then these needs to trigger an IF statement.

  5. Difference between "char" and "String" in Java - Stack Overflow

    Jan 12, 2015 · char means single character. In java it is UTF-16 character. String can be thought as an array of chars. So, imagine "Android" string. It consists of 'A', 'n', 'd', 'r', 'o', 'i' and again …

  6. How to use char from keyboard in if statement [Java]

    Dec 15, 2021 · whats your question?for starter, letters like F and C should be quoted by single quotes because they are characters, so use 'F' and 'C' instead – Sleiman Jneidi Commented …

  7. Purpose of char in java - Stack Overflow

    Dec 16, 2010 · Conceptually, char is a Unicode character (more precisely, a character from the Unicode subset that can be represented with 16 bits in UTF-16) which is something more …

  8. Converting a char to uppercase in Java - Stack Overflow

    Apr 14, 2017 · It has however some limitations since the world is aware of many more characters than can ever fit in 16bit char range. See also the following excerpt of the javadoc: Note: This …

  9. java - Why would you use Char as opposed to String ... - Stack …

    Dec 30, 2013 · A char explicitly requires one character. It can't take two, nor zero, and not even a null. This increases type safety where this requirement is appropriate. Also, using char is …

  10. java - How do I use a char as the case in a switch-case ... - Stack ...

    Using a char when the variable is a string won't work. Using. switch (hello.charAt(0)) you will extract the first character of the hello variable instead of trying to use the variable as it is, in …

Refresh