java


java all


12 User See All
hariyali adhayaruArunsingh RajpurohitNAGA SAI HEMANTH JAMILIAshish RamoliyaPatel Sachin
Arpan PatelAnsari Md TahirKamal HemaniAmit ShahAkash Gupta
Mayur ParmarHiral Ramani
Photo

Make Comments..!!


Ansari Md Tahir
Non Access Modifiers in Java

Final
Abstract
Static
Strictfp
Native
Synchronized
Transient
Like · Comment ·
Ansari Md Tahir
Type of Primitives

Char
Boolean
Byte
Short
Int
Long
Doubble
Float
Like · Comment ·
Shubham Pandey
int char byte
Like ·
Ansari Md Tahir
yes....
Like ·
Ansari Md Tahir
Reference variable Type

Static Variable
Instance Variable
Method Parameter
Local Variable
Like · Comment ·
Ansari Md Tahir
Rule for Instance variable

Can use any of the four access level
Can be marked final
Can be marked transient
Can be abstract
Can not be marked synchronized
Can not be marked strictfp
Can not be marked native
Can not be marked static
Like · Comment ·
Ansari Md Tahir
Try.. catch..finally

package javatest;

// @author MD. TAHIR

public class JavaTest {


public static void main(String[] args) {

System.out.println("Welcome java";
String s,s1;
s="string number 1 :";
s1="string number 2 :";
System.out.println(s+" "+s1);
int a,b,c,d;
a=10;
b=20;
c=0;
System.out.println("addition of 2 numbers : "+(a+b));

try
{
d=(a/c);
System.out.println(d);
}
catch(Exception ex)
{
System.out.println("error : "+ex.getMessage());
}
finally
{
System.out.println("finally statement ";
}
}
}
Output :

Welcome java
string number 1 : string number 2 :
addition of 2 numbers : 30
error : / by zero
finally statement
Like · Comment ·
Download Android App