Results 1 to 4 of 4

Thread: "char" datatype in Java

  1. #1
    Join Date
    Feb 2009
    Posts
    63

    "char" datatype in Java

    hi,

    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

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    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.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    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,

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    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.

Similar Threads

  1. Replies: 3
    Last Post: 10-01-2014, 10:40 AM
  2. Internet explorer 7:script error "line 1507 char 1" while print a page
    By Nammed Khuri in forum Technology & Internet
    Replies: 3
    Last Post: 11-02-2011, 01:17 PM
  3. Replies: 6
    Last Post: 18-05-2010, 12:27 AM
  4. Replies: 3
    Last Post: 25-06-2009, 03:49 AM
  5. Replies: 1
    Last Post: 06-11-2007, 02:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,987,796.71897 seconds with 16 queries