Ad

Saturday, January 30, 2016

Codecademy Learn Java tutorial walkthrough 4 Data Type III char

Unlike string char is used to represent a single character, example 'S' not 'So', and it must be enclosed in single quotes. It's useful for storage for single letters and conserve memory! For example, there's so need to store 'A' in a string that can store any more letters when we can store it in char. If we are writing a mini all of multiple choice questions, we can store the question labels in four chars ('A', 'B', 'C', 'D') and the answers in strings (example "None of the above").

System.out.println('C');

No comments:

Post a Comment

React UI, UI UX, Reactstrap React Bootstrap

React UI MATERIAL  Install yarn add @material-ui/icons Reactstrap FORMS. Controlled Forms. Uncontrolled Forms.  Columns, grid