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

High quality leads and directory scraping, Project Description: (1) I wa...

Project Description: (1) I want a comprehensive list of Australian chiropractors. The data requires coming from various sources including Google but the following are obligatory

Inheritance, Inheritance - is the inclusion of state and behavior of a ba...

Inheritance - is the inclusion of state and behavior of a base class in a derived class so that they are accessible in that derived class. The key benefit of Inheritance is that

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

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

Servlet, i nedd servlet basics

i nedd servlet basics

Explain the applet in java, Explain The Applet in java? The reason peo...

Explain The Applet in java? The reason people are excited about Java as more than just another OOP language is because it allows them to write interactive applets on the web.

Calculates number of negative and positive numbers in array, Question 3 ...

Question 3 Using this line: var posneg : array [1..15] of integer; Write a program that calculates the number of negative and positive numbers in the array. Users will

Explain java.util.random package, Explain java.util.Random package? The...

Explain java.util.Random package? The java.util.Random class permits you to create objects which generates pseudo-random numbers along with uniform or gaussian distributions ac

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