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

Solve neural network questions, Solve Neural Network Questions Project D...

Solve Neural Network Questions Project Description: You must know  Binary Chop and Kohonen Network, Backpropagation Algorithm. Implementation is required. Can using existi

Area of the curve, program t ofind area under the curve y=f(x) between x=a ...

program t ofind area under the curve y=f(x) between x=a and x=b integrate y=f(x) between the limits a and b

Information retrieval during multi-agent system, Information Retrieval duri...

Information Retrieval during Multi-Agent System with Data Mining in Cloud Computing Project Description: I have proposed one research model on "Information Retrieval during M

Develop student portal, Develop Student Portal Project Description: T...

Develop Student Portal Project Description: Technology to be used: Java, Portlets, Liferay, functions in Oracle DB, Boostrap. We need develop two pages, a header and foote

Create a program using constructors, Create a program Using Constructors? ...

Create a program Using Constructors? The further program uses the constructor to initialize a car rather than setting the areas directly. class CarTest7 { public static voi

Explain traversing through a collector using iterator, Explain traversing t...

Explain traversing through a collector using Iterator. Ans. We can access each element in Collection by using Iterators regardless of how they are organized in collector. Ite

Break statement, The break statement is utilized for terminating the curren...

The break statement is utilized for terminating the current While or For loop and after that transferring program control towards statement just after the terminated loop. The foll

Explain operator precedence in java, Explain operator precedence in java ? ...

Explain operator precedence in java ? It's probable to combine multiple arithmetic expressions in one statement. For example the subsequent line adds the numbers one by five:

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