You are on page 1of 3

impnote

===========
every java project developement approches's depend' on overloading(add on) &
override(replace)..

about overloading(add on):


==================
usecse:
=======
in developement if the requirements is.. if we want add on new logics to
existed logics , then i go for "methods overloading"..

syn)
====
same name with different signture(parameter)

note:
===
these overloading concept mainting by single class...

=====================================
ex:
===

class Developement
{
private int a,b; // req

public Developement(int a, int b) // constr


{
this.a=a;
this.b=b;
}

public void logic() // methods // whatspp // intilal developement


{
int res=a+b;
System.out.println(" u add res:"+res);
System.out.println("chat box");

}
public void logic(int...x) // addon to same logic(overloadin)
{
int sum=0;

for(int a:x)
{
sum=sum+a;
}
System.out.println(" ur updated add res are :"+sum);
}

public void logic(int m)


{
double c= Math.sqrt(m);
System.out.println(" ur again updated res:"+c);
System.out.println(" video call");
}

}// closing class

class OverloadingClient
{
public static void main(String []args)
{

Developement d=new Developement(10,20);


d.logic();

d.logic(11,22,33); // int...x=>int x[]={11,22,33};

d.logic(5);
d.logic(435,456,4575,67567); //int...x=> int x[435,456,4575,67567];

d.logic(435,456,4575,67567,45345);

d.logic(435,34,5,345,34,5,345,34,5,34,53,45,34,5,3456,45,645,6,45,645,6,45,645,6,54
,645,6,45,6,45,6,456,54,6,45,645,6,45,6,546,45,6,456);
}
}

/*
Developer obj:
==========

according to the above example... i undestood is syntax & intension of


overloading..

=> if updation are completely differnt from project client, then i go for methods
overloading only... but abit of different functionalaties are same, then these
case methods overloading not ok..

to solve the above points, from JDK1.5 onwords we have new concept called
"VAR-ARGS"..

Working with Var-args(varible argmument)..


===============================
syn)
=====
=> int...a ,char...b, float...c etc...

=> here ...variable internally acting like " single size of compiler time array's
syntax's"

============================

Q: what is DE b/w for loop & for-each..?


for loop: using this we can caluclate exactly iterations..
syn)
rotation count is 10;
for(int i=0;i<10;i++)
{
// logic
}

for each: using this we can caluclate dynamic index...


syn)
for(caluclationvariable :tagetvariable)
{
logics
}

execution float: according to the above syntax... target variable is storing in


to caluclation variable, then caluclation variable internally provide index..
ex:
====
int...x
5000;
for(int a:x) => for(a=0;a<5000;a++)
{
logics for a
}

*/

You might also like