Explain the char data type in java, JAVA Programming

Assignment Help:

Explain the char data type in java?

A char is a single character in which a letter, a digit, a punctuation mark, a tab, a space or something same. A char literal is a single one character enclosed within single quote marks like this

char myCharacter = 'g';

A few characters are hard to type. For these Java gives escape sequences. This is a backslash followed through an alphanumeric code. For instance '\n' is the newline character. '\t' is the tab character. '\\' is the backslash itself. The subsequent escape sequences are described:

\b

backspace

\t

tab

\n

linefeed

\f

formfeed

\r

carriage return

\"

double quote, "

\'

single quote, '

\\

backslash, \

The double quote escape sequence is used majorly inside strings where it would otherwise terminate the string. For example

System.out.println("And then Jim said, \"Who's at the door?\"");

It isn't essential to escape the double quote inside single quotes. The subsequent line is legal in Java

char doublequote = '"';

Related Discussions:- Explain the char data type in java

Instance variables and arrays, For an assignment I need to write an array p...

For an assignment I need to write an array program to go along with an instance variable. I keep getting the no main class error when I run my program.

Describe graphics objects, Describe Graphics Objects ? In Java all draw...

Describe Graphics Objects ? In Java all drawing takes place via a Graphics object. This is an example of the class java.awt.Graphics. Initially the Graphics object you use w

JDI, i need help

i need help

Java and Arrays, AskWrite an application that uses an Array to store 10mess...

AskWrite an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a message could be “I love

Difference between composition and aggregation, Aggregation Comp...

Aggregation Composition Aggregation :  An   association   in  which  one  class refers to collection or a another class. This is a part of  a  who

Mobile pop-under script for mobile browsers, Project Description: Give a...

Project Description: Give a script that will produce a pop-under on a mobile landing page -We can host our own landing page and we will want to change the destination URL for

Want a page to store emails when click as save, Want a page to store emails...

Want a page to store emails when click as save, then pass along to another page with the emails in the URL Project Description: I have a page that populates with listing; the

43560 square feet., calculate the size of the tract of land by the size of ...

calculate the size of the tract of land by the size of an acre to get the number of acres.

Method to define the packages in java programme, Q. Write the method to def...

Q. Write the method to define the packages in java programme. Explain. Ans. Package: When we work on a project we have to break our programme in several classes. To organize

Pseudocodes, Draw a 5 inch square on the screen using pseudocode

Draw a 5 inch square on the screen using pseudocode

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd