Please enable JavaScript.
Coggle requires JavaScript to display documents.
Programming with JAVA (Classes,Objects & Methods (Visibility control…
Programming with JAVA (
Classes,Objects & Methods,
Packages: Putting Classes Together,
Multithread Programming,
Overview of Java Language,
Java Evolution,
Managing Errors & Exceptions,
Constants, Variables, Datatypes,
Fundamentals of OOP,
Applet Programming,
Arrays, Strings & Vectors,
Interfaces Multiple Inheritance,
Collection,
Contributors:,
Managing Input/Output,
Operators, Exprission,
Decision Making & Branching,
Decision Making & Looping,
operators and expression
operator:java languag has an,
Decision making and branching
key factor is :entry controlld loop
:exit controlld loopwhile statement:
syntax:initialization
whille(test condition)
{
body of the loop
}Do statement:
initialization
do
{
body of the loop
}
while(test condition)for statementfor initionalization : test condition :increment)
{
body of the loop
}nesting for loopsfor(i=1;i<10; ++i)
{................................
...............................
for(j=1;j<! =5; ++j)
....................................
...................................
inner loop
outer loop
.........................................
.........................................
}
...........................
...........................labelled looploop1: for (....................)
{
..................
.................
}
block statement can be labelled shown belowblock1: {block2: { }
}
,
scope of variable
. instance variable
.class variables
.local variables*instance variable are created when the object are instantiated and therefore they are associated with the objectsnested program blocks{
int x=0; block1
{
: block2
:
int n=5;
;
;
}{
:
:
}},
java operators:
1>arithmatic operator
2>relational operator
3>logical operator
4>assignment operator
5>increment and decrement operator
6>conditionaloperator
7>bitwise operator
8>special operator,
1>arithmatic operator
multiplication
/ division
% modulus
ex:a*b,a-b,a/b,a%b,a+b;2>relational operator< is less then
<= greater then or equal to
less then
= less then or equal to
== equal to
!= not equal to
syntax:ae-1 relational operator ae-2
here ae arthmetic expression3>logical operator:java has three logical operators&& logical AND
|| logical OR
! logical not4>assignment operatorsyntax: v op=exp;a = a+1
a = a-1
a = a*(n+1)
a = a/(n+1)
a = a%b5>increment and decrement operator++m or m++
--m or m--
++m is equvivalent to m=m+1;
--m is equvivalent to m=m-1;6>conditionaloperatorsyntax:exp1 ? exp2 :exp3a=10;
b=15;
x =(a>b)? a:b;7>bitwise operator& bitwise AND
! bitwise OR
^ bitwise exclusive OR
~ one's complement
<< shift left
shift right
shift right with zero
8>special operatori>instance operator:instance of an object reference operator
and returns true if the object on the left hand side
is object instance of class given on R.H.S
EX:person instanceof studentii>DOT operator:is used to access the instance variable&method of class objects person1.age
person1.salary(),
Type conversion in eXpression1>float to int causes tranction of the fractional part
2>double to float causes ronding of degits
3>long to int causes dropping of the excess higher order bitscasting value:-syntax=(type_name) expressionx=(int) 7.5 7.5 is converted to integer by trancationa=(int)21.3/(int)4.5 evaluated as 21/4 and the result would be 5b = (double) sum/n division is done in floating point modey =(int) (a+b) result a+b converted to integer general type casting:syntax:
class SampleGenericclass <T>
{
}mathematical function syntax:Math.function_name()ex:sin(x),cos(x),tan(x).......)