Showing posts with label institution. Show all posts
Showing posts with label institution. Show all posts

Tuesday, April 2, 2019

Constructors in Java

Constructor Java Training in Chennai is a block of code in the program,constructor is same as method,constructor doesn’t have any return type where method has return type.Constructor name is same as class name

Advantages of constructor
When we use constructor at the time of writing Java application then we get following advantages.
1) It eliminates in placing default values.
2) It eliminates in calling ordinary methods.


Characters of constructor
If we want to use a constructor as a part of Java program then we have follow properties.
1) Constructor will be called by the JVM implicitly when the object is created.
2) Constructor Core Java Training in chennai name is most similar to class name.
3) Constructor will not have any return type even void also
( if we write any return type then it will be treated as "Ordinary Method".)
4) Constructor should not be static ( because of constructor calling each & every time when an object is created ).
5) Constructor of java never participates in inheritance process (Because every constructor is meant for initializing with their own data member but not data member of another class.
6)
a)If the access modifier of the constructor is private then an object of an corresponding Java Training Institute in chennai class can be created in the class context but not in other class context.
b) If the access modifier of the constructor not private then an object of the corresponding class can
be created both class context and in another class context.


Types Of Constructors:

Constructors are classified into three types,they are:
1)Default Constructor
2)No-arg Constructor
3)Parameterized Constructor


Default Constructor:
The default constructor is nothing but a simple constructor ,it is enclosed in the .class file ,Core Java Training in chennai the default constructor will automatically Included in the file.


When the user don’t include the default constructor,the source code will automatically enclosed the constructor to the .class file


Example of Default Constructor:
public class Hello {
  String name;
  //Constructor
  Hello(){
     this.name = "Beginners";
  }
  public static void main(String[] args) {
     Hello obj = new Hello();
     System.out.println(obj.name);
  }
}


No-arg Constructor:
No-arg constructor is defined as Constructor with no arguments.it is same as default constructor.Java Training in chennai


Example of no-arg Constructor:
class Demo
{
    public Demo()
    {
        System.out.println("This is a no argument constructor");
    }
    public static void main(String args[]) {
    new Demo();
    }
}

Parameterized Constructor:

Constructor with arguments Java Training Institute in chennai are known as parameterized constructor.

Example of Parameterized Constructor:
public class Employee {


  int empId;  
  String empName;  
   
  //parameterized constructor with two parameters
  Employee(int id, String name){  
      this.empId = id;  
      this.empName = name;  
  }
  void info(){
       System.out.println("Id: "+empId+" Name: "+empName);
  }
  
  public static void main(String args[]){  
Employee obj1 = new Employee(10245,"Chaitanya");  
Employee obj2 = new Employee(92232,"Negan");  
obj1.info();  
obj2.info();  
  }
}
Output:
Id: 10245 Name: Chaitanya
Id: 92232 Name: Negan

ASP.NET Application & PAGE Life Cycle

Dot Net Training in chennai is a web development platform developed by Microsoft,it has versatile features and large number of class libraries.it is used to develop web-based application.it supports many language like C#,visual basic dot net,etc.


Life Cycle of ASP NET
This Life cycle is all about the Dot Net Course in chennai:
At the time of launch the following life cycle of dot net is created,it has various stages,they are:
1)  Application Start
2)  Object Creation
3)  Http Application Creation
4)  Dispose
5)  Application End
Let’s see the various stages briefly:

1)Application Start
The Dot Net Training and placement in chennai application life cycle is start because of user request for web server for the ASP.NET application,this happens when the user is using the dot net application first time is loaded,the user goes to home page in the application and the application is started only by web server,web server only has the capability to start the application,to execute the application web server is very useful.web server also have global variables and the variables value to be set at default.


2)Object Creation
 The next level of stage is to create the object such as HttpContext,HttpRequest,and HttpResponse.this process of creation is done by Asp.Net Training in chennai web server.The HttpContext is nothing but a container for the HttpRequest & HttpResponse object.The HttpRequest object has the details about the latest request,including web application cookies and browser loading details.The HttpResponse object has the response which is sent to the user/client.

3)Http Application Creation
The Http Application creation is Best Dot Net Training in chennai created by web server.the process of Http Application creation is to process the frequent request  sent to the application.For Example,assume that we have 5 web application.one is a e-commerce application and second is news website and third is grocery list website so on,For each application the user has 2 HttpApplication object is created,If the user has any request for each sites it can be processed by individual Http Application.


4)Dispose
In this process the request of user is deleted or disposed,this process is done before the application label is destroyed,At that time client can use this method to release the unprocessed resources individually.


5)Application End
This is the final process of the application.in this process finally the application is unprocessed from the memory.


DOT NET Page Lifecycle:
What is Dot Net Page Lifecycle?
Dot Net application is released,there are several number of series carried out,the page of Dot Net Training center in chennai is have a particular life cycle,this happens before the user get the response,these steps are listed below:
1)  Page Request
2)  Page Start
3)  Page Initialization
4)  Page Load
5)  Validation
6)  Post Back Event Handling
7)  Page Rendering

8)  unload