0 ratings0% found this document useful (0 votes) 32 views4 pagesBasics of Java
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
BASICS OF JAVA
Public class classname
ATUL Kum aR(LINKED IAL).
is NOTES GALLERY (TELEURAM )
jeThe Main Method _
l@Public Static void Main (),
e Pylnt text
= Susrem. out. printin (“Hetlo Woyld”) 5
Data types
int, chay, Float, double , void , bool.
le comments
@// single ine comments
/* multiline
coerament
Text | ®
Axithmatic operators
et-( Addition), —(Subtvaction), *(Mmultipiication), / (division)
le Reiarto Operaroy.
2 = (less than ov equal to), < Cress than), > (greater
than), >= (gveater than or eyial to), ==( equal to© Logical Opeyator
71! (logical OR), &%&( togical AND) , | Ctogical Nor),
© Foy Loop |
For ( statement 1; statement 2; Statement 3)
e While Loop
—__I] code block.
AIOTES GALCeRy (TELEGRAM,
o If - else
® §€ ( condiHon )
! C
II Code of False candition.
a
je Ayray
i» Il declave aryat
Tees ers@ Swi h
@ Switch ( expression) €
case vatue L:
I) Code to be executed
break;
“Care value 2:
!) Continue
default:
Hl Code to be executed If all the cases ave not matched.
a
MOTES GALLERY (TELELRAM)|
je File Methods
~ _l-} CanRead C)
2] CreatenewFile()
“S| Canwivite ()
4] existcl )
S|} gerniame C )
& Put
goss QetabsoiurePath ()
B/ length € )
“ list C)
10-1 MKdty( )
jo Cveg € 9 CIQSS
* fl a Class With name “main” With variable x.
public class Maln £o create of name Myobj".
ic class main ©
e
NIOTES GALLERY (TELEGRAM),
© T/o Operators
Sustem.out: srand@rd output Stream.
-
me
2-] Sustem.in 2 Standard input stream.
3.
System. ery: Standard eryor stream.