CS 151 Lecture Notes - Lecture 5: Boolean Data Type, Floating Points, Floating Point

77 views2 pages

Document Summary

Eight primitive data types: four subsets of integers, two subsets of floating point numbers, a character data type, and a boolean data type. Two basic types of numeric values: integers and floating point numbers. Short: 16 bits int: 32 bits, integer literals (without l or ) long: 64 bits, integer literals (with l or ) Floating point numbers (have fractional value) float: supports very large and very small numbers, but only 7 significant digits, 32 bits in ieee 754 format. Append f or f to the end of floating point literal to treat like a float. Double: 64 bits in ieee 754 format. Numeric literals of type double can be followed by a d or d if. A character literal is expressed in a java program with single quotes, such as "b" desired or "j" or ";" The characters we can manage are defined by a character set, which is simply a list of characters in a particular order.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents