Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 26-06-2009
Join Date: Feb 2009
Posts: 63
"char" datatype in Java


Can anybody please explain me about "char" in Java. What is the significance of this datatype ?

If any ideas, please provide the information regarding this......thanks
Reply With Quote
Old 26-06-2009
Join Date: Feb 2008
Posts: 1,848
Re: "char" datatype in Java

'char' in Java refers to 'character'. The Character class wraps a value of the primitive type char in an object. An object of type Character contains a single field whose type is char.
In addition, this class provides several methods for determining a character's category (lowercase letter, digit, etc.) and for converting characters from uppercase to lowercase and vice versa.

Character information is based on the Unicode Standard, version 3.0. The methods and data of class Character are defined by the information in the UnicodeData file that is part of the Unicode Character Database maintained by the Unicode Consortium. This file specifies various properties including name and general category for every defined Unicode code point or character range.
Reply With Quote
Old 26-06-2009
Join Date: Jan 2008
Posts: 1,515
Re: "char" datatype in Java

In Java,
A char is a single character, that is a letter, a digit, a punctuation mark, a tab, a space or something similar. A char literal is a single one character enclosed in single quote marks is represented as -

char myCharacter = 'a';

Some characters are hard to type. For these Java provides escape sequences. The following escape sequences are defined:

\b backspace
\t tab
\n linefeed
\f formfeed
\r carriage return
\" double quote, "
\' single quote, '
\\ backslash,
Reply With Quote
Old 26-06-2009
Join Date: Oct 2005
Posts: 2,389
Re: "char" datatype in Java

Java provides an assistance to represent text as a combination of digits, letters, punctuation, words, sentences, and more through the Character, String, StringBuffer, and StringTokenizer classes. Java has a "character" datatype and "char" keyword to represent and manipulate characters.
Reply With Quote

  TechArena Community > Software > Software Development
Tags: , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: ""char" datatype in Java"
Thread Thread Starter Forum Replies Last Post
msiexec.exe Application Error "The instruction at "0x00f33fe8" referenced memory at "0x00f33fe8". The memory could not be "written"." haritable Office Setup 3 10-01-2014 10:40 AM
Internet explorer 7:script error "line 1507 char 1" while print a page Nammed Khuri Technology & Internet 3 11-02-2011 01:17 PM
<input type="button" value="Enregistrer" onclick="location.href=../asp/PRaces.asp"> Luz Software Development 6 18-05-2010 12:27 AM
Power Mgt: "Turn off monitor" "Never" always reverts to "After 20 mins" akbar Windows XP Support 3 25-06-2009 03:49 AM
Adding commands to "Folder Options/Edit File Type/Actions" grayed-out "Edit" & "Remove" Green_XP Windows XP Support 1 06-11-2007 02:18 PM

All times are GMT +5.5. The time now is 04:40 PM.