Class 12 Finesh Java Practical File
Class 12 Finesh Java Practical File
" Program
I ! ,_. I l 1 11•,' r ~ ,1 1
(String[] args) {
,·:,y·-, t ,__'Ill. uui . pr ir1t In( ,·,,:1r 1
• l·j ' ,, ) ,'
Output
He ll o, world'
Example 3: Java if...else Statement
',.' 1 l I
f]IJIT'-h•''
Run Code »
Output
Output
Example 2: Assignment Operators
Output
Example 3: Relational Operators
Example 5: Increment and Decrement Operators
Output
Example 1: Java break statement
II for looi..,
Run Code »
Output:
Example: Access Array Elements
Output
Example: Java Constructor
I ,l'II•"
Ru n Corje ) >
Output:
Example 1: Java Inheritance
Output
?,' , I •II •· , • I
: • - j.
Example: Java Polymorphism
',_•_1\,_• JI I ~-l •·
Output
Example: Exception handling using try...catch
R,.m Codt.> ,)
Output
Example 1: Java Encapsulation
Output
Example 1: Java Nested for Loop
Run Cod,e »
Output
Example: Create objects inside the same class
Output
L_;: · t r - - 'J ~
1. Get the Length of a String
To find the length of o string, we use the Iengch() method. For
example,
Run Code, ,)
Output
-r 1 :. ...,,... • _ 1. • •
L,...r:_ ..1 ' _