Wednesday, 17 December 2014

AngularJs - a saviour for ui designers

What is a Angular Js?
it is javascript framework with some rules to be followed to apply them in your basic html page.

Binding:-

binding is used to display your data in your html parallely you feed that data in some form.
also it is used to display data in your required manner and style in html.

e.g- <html ng-app="myApp"> // ng-aap is a built in directive which is a attribute type and myApp is                                                    //name of your module or we can say its the starting point of angularjs                                                   //like a main function in  your java program.

     <body>
     <div ng-controller="FirstCtrl">
     <input type="text" ng-model="message">// basically a directive add functionality to the existing                                                                            //html elements in case here it is a input tag but it got a                                                                           //additional functionality of model  using which text //                                                                            //entered in input field will be treated as data for binding                                                                       //purpose with any DOM element of html.
     <h1>{{message}}</h1>                           // the curly braces will do the binding
     </body>
     </html>

Monday, 1 December 2014

Go easy with JAVA - a quick glance

CLASS - defines shape and nature of objects also a new data type. Once this data type is created then a object of this type can be created.a class contain data called instance variable  and code that operates that data called method.

Object :- a object contains all copy of instance variable .

e.g- class Box{
                 double width;
                  double height;
                        }
       Box b =new Box(); // b is a reference variable to object of Box class and it has type of class Box.
                                       // b  stores the address of object of class Box.


USE OF DOT OPERATOR?
to access the copy of variable among each object . here b reference variable has copy of double width and double height so to access them we use dot operator .Here comes a e.g of code reusability.


CONSTRUCTOR :-

1. objects are allowed to get initialize whenever they are created using constructor.
2.it is called before the "new".
3. constructor does not have return type because it is already of class type .


use of THIS:-
1. it refers to current object.
2. it is illegal to create two local variable of same name ;but it can be done using this keyword.
3.we can have local variable which overlap with name of instance variable,

e.g:-
class Box{
double width;
double height;
Box (double width,double height)
{
   this.width=width;// width on left side refer to instance variable
this.height= height;// height on left side refer to instance variable.
}

Call By Value:- whenever we pass primitive data type as parameter  it is passed as call  by value.
here change in value of argument does not impact on the subroutine variables.

Call By reference :- the object are always passed as call by reference because  the reference variable carry nothing but the reference of object or its address we can say so any change in the passed object will make impact on original object.


MORE TO COME..