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

What is constructor, What is Constructor? A constructor is used to init...

What is Constructor? A constructor is used to initialize a newly created object. It's called just after memory is allocated for the object. It can be used to initial

Develop the back end of a calculator application, For this assignment, you ...

For this assignment, you will develop the back end of a calculator application. The GUI (graphical user interface) has been provided by your instructor. The application will requir

Information retrieval from multi-agent system, Information Retrieval from M...

Information Retrieval from Multi-Agent System with Data Mining in Cloud Computing I have proposed one research model on "Information Retrieval during Multi-Agent System with Dat

Excel file to responsive css/html page, Excel File to Responsive CSS/HTML p...

Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field

Admin panel to upload my html and psd templates, Admin panel to upload my h...

Admin panel to upload my html, php, psd templates Project Description: -Upload my psd file and convert -Login panel -Client login panel -Encryption code -Send dem

Describe life cycle of thread, Describe life cycle of thread. Threads f...

Describe life cycle of thread. Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads are listed below: Newborn state: A

Concurrent Programming, Problem 1 A savings account object holds a non-nega...

Problem 1 A savings account object holds a non-negative balance, and provides deposit(k ) and withdraw(k ) methods, where deposit(k ) adds k to the balance, and withdraw(k ) subtra

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