0% found this document useful (0 votes)
39 views4 pages

Table 5-1 Some Scanner Methods: To Read This - . - . - . Make This Method Call

The document contains tables summarizing various data types and operators in Java. Table 5-1 lists scanner methods for reading different data types from a line of input. Table 7-1 shows Java's primitive numeric types including their name, range of values, and whether they are used for whole or decimal numbers. Table 8-1 lists comparison operators and their meanings. Table 8-2 lists Java's primitive non-numeric types including their name and range or possible values.

Uploaded by

David Berto
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views4 pages

Table 5-1 Some Scanner Methods: To Read This - . - . - . Make This Method Call

The document contains tables summarizing various data types and operators in Java. Table 5-1 lists scanner methods for reading different data types from a line of input. Table 7-1 shows Java's primitive numeric types including their name, range of values, and whether they are used for whole or decimal numbers. Table 8-1 lists comparison operators and their meanings. Table 8-2 lists Java's primitive non-numeric types including their name and range or possible values.

Uploaded by

David Berto
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

.

Table 5-1 Some Scanner Methods


To Read This . . . A number with no decimal point in it A number with a decimal point in it A word (ending in a blank space, for example) A line (or what remains of a line after youve already read some data from the line) A single character (such as a letter, a digit, or a punctuation character)
findInLine(.).charAt(0)

. . . Make This Method Call


nextInt() nextDouble() next() nextLine()

Table 7-1 Javas Primitive Numeric Types


Type Name Whole Number Types
Byte Short Int Long

Range of Values 128 to 127 32768 to 32767 2147483648 to 2147483647 9223372036854775808 to 9223372036854775807 Decimal Number Types

Float Double

3.41038 to 3.41038 1.810308 to 1.810308

Table 8-1 Comparison Operators


Operator Symbol
== != < > <= >=

Meaning is equal to is not equal to is less than is greater than is less than or equal to is greater than or equal to

Example
yourGuess == winningNumber 5 != numberOfCows strikes < 3 numberOfBoxtops > 1000 numberOfCows + numberOfBulls <= 5 gumballsPerKid >= 10

Table 8-2 Javas Primitive Non-numeric Types


Type Name Character Type
char

Range of Values

Thousands of characters, glyphs, and symbols

Logical Type
boolean

Only true or false

You might also like