Thursday, March 4, 2021

 What is Exception Handling ??

In Java Exception Handling is a mechanism or process when we use to handle some error over the programme ....

when we write our code some error or bugs which is predictable when we execute that particular programme we have crash our programme on that case we will handle our error through exception handling using Try and Catch block or Throws Keyword in java programming ....

When we use Try Block in our code we can handle some errors during compile time and as well as runtime and 

When we use Throws Keyword we can Handle our error or Exception during the compile time only 

not for the run time you can know more about if want to go for videos on my channel...Code With Irfan


 

Wednesday, February 10, 2021

 What is Encapsulation ?? and how can achieve security using Encapsulation Mechanism ...!!

In simple word  Encapsulation is a process that we can achieve data hiding ...

using getter and setter method ...

 if  you want to secure your data we have to use Encapsulation mechanism to get security of your data

some time you does not want to get permssion to your users for changing some thing in that case we have used Encapsulation mechanism..


if you want to know more about how can we achieve data Hiding using Encapsulation with the 

help of getter and setter methods ... 

then click on the link below and you will get this ..

 What is Polymorphism ??

poly means( many) morphism means (form )

that  means one can perform many action like you me etc ..

we can talk we can sleep we can eat we can run etc ... 

In programming language we can perform many action using 

method..

see example :   MyMethod ( ) {

.............

..............

}

 MyMethod ( int p, String s ) {

.............

..............

}

 MyMethod (int s ) {

.............

..............

}


if you want to know more how can achieve polymorphism ...

go to this link and gain your knowledge as well



 What is for each loop ???

for each loop is a special type of loop in java programming  that is more efficient to write in a code  

it is helpful to print element in a efficient manner 

less type and result is same as for loop ...

see example :

for(int i=0;i<=5;i++){

int k;             //for loop

System.out.println(" "+k);

}


for(int k : int i){

System.out.println(" "+k);      //for each loop 

}  if you want to know more about  [ for loop ,for each loop, do while loop ,while loop]..

then click on the link below ..




 What is loop ??In programming (for loop ,while loop,do while loop)..and How does it work ??

loop you can say one task can perform many times like a sport man moving in a ground many times

and a athletes run in a ground many times...

that is called looping ....

In programming language loop are three types i.e (for loop ,while loop,do while loop )

for loop while loop and do while loop same work but it is used according to condition ...

for loop is efficient than any other loop ....

so I recommend you that use for loop and foreach loop 

we will  talk about later a special loop in java programming 

that is for each loop 

if you want to know more about (for loop,while loop,do while loop,,for each loop)....

then click on the link below and it will redirect to Youtube page.. 

what is variable in programming language??

In simple word variable is a container which is used for storing the data 

just like a box which is used for storing the luggage ..

in programming language  variable store data in it like 

int a =10; legal way to assign 

int 10=a; illegal way to assign

string b="Hi I am there ";

char c='A'; 


you can assign variable like that if 

you want to know more then switch this link and you will know about 

how to assign chaining variable like that example  x=+y;  or x=x+y;

click on the link below and get proper knowledge with the help of this video

 



 what is static keyword in java ??

and how does it work ??


static keyword is used for many purpose like saving memory 

when you declared static as a variable methods ,blocks etc 

then it will allocate in a memory in ones time in a memory when your class will load 

it will directly stored in a stack memory 

basically memory are devided into two parts i.e Heap memory and Stack memory inside RAM memory.


when you make your methods,variables as a static member then you don't have need to make a object 

of a class you can simply access your method as a class name 

not need to make object of a class then access 


example; if you declare your method as a instance  member

then you will need to make object of a class then you can access 


see : public  Myclass {

...............

..............


mymethod(){

..............

...............

}

}


Myclass obj =new Myclass();

obj.mymethod     //you are accesing mymethod  with the help of obj1


if you declared as a static member 

then you haven't need to make object of a class

you simply access with the name of 

class

like that  ex:  Myclass.obj  //you are  accessing mymethod with the name of  your class

 What is Inheritance ??

In simple word you can say inherit some one properties and use as itself 

you know that you have taken birth in your father home then you have used properties of your father with your birth that means you are inherited your father properties..like thier home,bathroom,room etc...

In programming you can say code reusabilty means you don't have need same code means repeated code that is make your code unefficient 

so on that case we are using inheritance to achieve code reusability 

if you want to know more about it then simply switch this link 


 What is Constructor ??


Before moving on Constructor part we will know about 1st what is Object in programming language object is a real entity which is  our daily day life you can say in programming we relate real life entity to it It means that suppose you have a box of name box1 that is a real life entity

in programming we say that it is box1 object 


so Constructor is basically used for initializing the object 

if you make obect of box1 then simply comiler will make a default constructor which is initialized the object with assigning by default values like 

0, 0.0, null,false which is dafault values of primitive data type...



but you think and imagine of box1 object ??? 

is there any object exist with length =0; breadth=0,heigth=0,  No there is not 

so how could you make this real object ??


yes you can make object with the help of Constructor 


initialize the variables of length=5;heigth=8; breadth=8; 

 this will represent the actual object in your programming ...


so this is the basic concept of Constructor if you want more about it then simply switch this link it will help to understand the 

basic concept of Constructor ...


 What is this  keyword ??

how does it work ??



this keyword is used for differtiate or eliminate confusion between instance variable(Class member) and local varible i.e  inside the method.

and this keyword is used to refer current object if want to know more about this keyword then simply switch this link it will give you the best ..


 What is super keyword ??

how does it work ??


basically super keyword is used to refer a current object of child class to super class 

when you want to call a super class variable,method or a constructor you simply write super();


if you want to pass some of the arguments then simply write like that    super(5);,   super(5,"Hi I am there ")..

if you want to know more about super keyword and chaining constructor as well as this keyword then i will prefer to my channel videos which is 

 chaining constructor in java .. 


Featured Posts