Logo

Codcups

Complete Java Reference's

Intro Of Java Language?

Java is a high-level, object-oriented, platform-independent programming language. It was developed by James Gosling at Sun Microsystems and officially released in 1995. Java is designed to be write once, run anywhere (WORA) — which means code written in Java can run on any platform that supports Java without modification.

Java Language Full Reference Table

1. Java Keywords

KeywordDescription
abstractSpecifies that a class or method is abstract
assertUsed for debugging and validating assumptions
booleanDefines a variable with true or false
breakExits a loop or switch statement
byte8-bit integer type
caseDefines a case in a switch statement
catchHandles exceptions
char16-bit character type
classDeclares a class
continueSkips current loop iteration
defaultDefault case in a switch statement
doStarts a do-while loop
double64-bit floating point type
elseSpecifies block if condition is false
enumDefines an enumerated type
extendsIndicates inheritance
finalDefines constants or prevents overriding
finallyBlock always executed after try-catch
float32-bit floating point type
forStarts a for loop
ifConditional statement
implementsImplements an interface
importImports other classes or packages
instanceofChecks if object is an instance
int32-bit integer type
interfaceDeclares an interface
long64-bit integer type
nativeLinks to native code (non-Java)
newCreates new objects
nullRepresents a null reference
packageDefines a package
privateAccess modifier
protectedAccess modifier
publicAccess modifier
returnExits a method and returns a value
short16-bit integer type
staticDenotes a static method or variable
strictfpFor consistent floating-point behavior
superRefers to superclass
switchMultiple-branch statement
synchronizedControls thread access
thisRefers to current object
throwThrows an exception
throwsDeclares exceptions
transientPrevents serialization
tryDefines a block to test for errors
voidSpecifies no return value
volatilePrevents compiler optimization
whileStarts a while loop

2. Data Types

TypeDescription
int32-bit integer
long64-bit integer
float32-bit decimal
double64-bit decimal
byte8-bit integer
short16-bit integer
char16-bit Unicode character
booleantrue or false

3. Access Modifiers

ModifierDescription
publicAccessible everywhere
privateAccessible within class only
protectedAccessible within package and subclasses
defaultAccessible within the package

4. Operators

OperatorPurpose
+Addition / String concatenation
-Subtraction
*Multiplication
/Division
%Modulus
++Increment
--Decrement
==Equality
!=Not equal
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal
&&Logical AND
||Logical OR
!Logical NOT
=Assignment
+=Add and assign
-=Subtract and assign

5. Commonly Used Classes

ClassUse
StringWorking with text
ScannerInput handling
MathMath functions
ArrayListResizable array
HashMapKey-value pairs
DateDate/time operations

Click to go back on notes page.