100% found this document useful (1 vote)
63 views1 page

Java Facts

The document provides useful facts about Java including comparison, arithmetic, and logical operators; native data types; selection and assignment operators; casting; Scanner and print methods; decision statements; and String, Character, and Math methods. It summarizes key components of the Java language syntax and APIs.

Uploaded by

api-26289050
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 DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
63 views1 page

Java Facts

The document provides useful facts about Java including comparison, arithmetic, and logical operators; native data types; selection and assignment operators; casting; Scanner and print methods; decision statements; and String, Character, and Math methods. It summarizes key components of the Java language syntax and APIs.

Uploaded by

api-26289050
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 DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

USEFUL JAVA FACTS

Comparison operators case 'value': {statement block;


==, <, >, !=, <=, >= [break;]}
..
Arithmetic operators [default: {statement block}]
+, -, *, /, %, ++, -- }

Logical operators String methods


&&, ||, ! int length()
char charAt(int index)
Native data types int compareTo(String
char, byte, short, int, long, anotherString)
float, double, boolean String endsWith(String suffix)
int indexOf(String str)
Selection operator int indexOf(String str, int
. fromIndex)

Assignment operators Character methods


=, +=, *=, -=, /+, %= boolean isDigit()
boolean isLetter()
Casting
(type) var

Scanner (input) methods


int nextInt()
String next()

Print (output) methods


System.out.print()
System.out.println()

Math methods
double Math.random()

Decision statements
if(boolean statement){
statement block
}
[else{
statement block
}]

switch(intDataType){

You might also like