SlideShare a Scribd company logo
1 of 12
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Quontra Solutions
by
Java Constructors
Constructor
• Constructor in java is a special type of method that is used to
initialize the object
• Java Constructor is invoked at the time of object creation
• They do not contain any return type
• Constructor name is same as class name
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Types of Constructors
• Default constructor (no-arg constructor)
• Parameterized constructor
Types of constructors
Default constructor Parameterized constructor
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Default Constructors
Example for default constructor:
class Cons{
cons(){
System.out.println("constructor is created");
}
public static void main(String args[]){
Cons c=new Cons();
}
}
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Parameterized Constructors
Example for parameterized constructor
class Student4{
int id;
String name;
Student4(int i,String n){
id = i;
name = n; }
void display(){System.out.println(id+" "+name);}
public static void main(String args[]){
Student4 s1 = new Student4(111,"Karan");
Student4 s2 = new Student4(222,"Aryan");
s1.display();
s2.display(); }
}
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Difference between constructor and method
Constructor Method
Constructor is used to
initialize the state of an
object.
Method is used to expose
behaviour of an object.
Constructor must not have
return type
Method must have return
type.
Constructor is invoked
implicitly.
Method is invoked explicitly.
Constructor name must be
same as the class name.
Method name should not
be same as class name
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Constructor Overloading
• Constructors are methods that can be overloaded, just like any other
method in a class.
• Constructors having the same name with different parameter list is
called constructor overloading.
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Topics Covered during Training
• Classes, Objects, Keywords, Methods
• Exception Handling
• String Handling
• Multithearding
• AWT
• Swing
• Applet
• Collections
• Hibernate
• Struts etc………………
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Quontra Solutions Offers:
Data Warehouse
OBIEE, Cognos, Informatica
Microsoft Courses
C# .NET, ASP .NET, VB .NET
& etc….
Programming Courses
Core Java, Adv Java,
J2EE, & etc….
Testing Tools
Manual, QTP, Selenium,
Load Runner
Salesforce CRM
Salesforce CRM, ADMIN,
Developer
Networking Courses
Linux, Unix, Sun Solaris,
CCNA
Mobile Apps
Android, IOS, Cloud
Computing
Data Base
SQL PL/SQL, SQL server
DBA, ORACLE 12C DBA
Other Courses…
Business Analyst, Hadoop,
Qlikview
Contact Us
Call:(404)900-9988
Mail:info@quontrasolutions.com
Visit:www.quontrasolutions.com
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Follow us
Facebook: https://www.facebook.com/quontrasolutionsusa
Twitter : https://twitter.com/QuontraTraining
Google+: https://plus.google.com/+Quontrasolutions/post
Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
Java constructors

More Related Content

What's hot (20)

Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
OOP java
OOP javaOOP java
OOP java
 
java token
java tokenjava token
java token
 
Constructor and Types of Constructors
Constructor and Types of ConstructorsConstructor and Types of Constructors
Constructor and Types of Constructors
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
String in java
String in javaString in java
String in java
 
Constructors in java
Constructors in javaConstructors in java
Constructors in java
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in java
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Interface in java
Interface in javaInterface in java
Interface in java
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
WHAT IS ABSTRACTION IN JAVA
WHAT IS ABSTRACTION IN JAVAWHAT IS ABSTRACTION IN JAVA
WHAT IS ABSTRACTION IN JAVA
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
JVM
JVMJVM
JVM
 

Viewers also liked

Java lec class, objects and constructors
Java lec class, objects and constructorsJava lec class, objects and constructors
Java lec class, objects and constructorsJan Niño Acierto
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in javaRaja Sekhar
 
constructor and destructor-object oriented programming
constructor and destructor-object oriented programmingconstructor and destructor-object oriented programming
constructor and destructor-object oriented programmingAshita Agrawal
 
OCA JAVA - 1 Packages and Class Structure
 OCA JAVA - 1 Packages and Class Structure OCA JAVA - 1 Packages and Class Structure
OCA JAVA - 1 Packages and Class StructureFernando Gil
 
javaMethod.ppt
javaMethod.pptjavaMethod.ppt
javaMethod.pptzahid32
 
Application of programming languages in civil engineering
Application of programming languages in civil engineeringApplication of programming languages in civil engineering
Application of programming languages in civil engineeringMuhammad Usama Umer
 
Java class 5
Java class 5Java class 5
Java class 5Edureka!
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in JavaNiloy Saha
 
IMPACT OF IT IN CIVIL ENGINEERING
IMPACT OF IT IN CIVIL ENGINEERINGIMPACT OF IT IN CIVIL ENGINEERING
IMPACT OF IT IN CIVIL ENGINEERINGKulbir Singh gill
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPTPooja Jaiswal
 
Core java concepts
Core java  conceptsCore java  concepts
Core java conceptsRam132
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java ProgrammingRavi Kant Sahu
 

Viewers also liked (20)

Constructors & destructors
Constructors & destructorsConstructors & destructors
Constructors & destructors
 
Methods and constructors in java
Methods and constructors in javaMethods and constructors in java
Methods and constructors in java
 
Java lec constructors
Java lec constructorsJava lec constructors
Java lec constructors
 
Constructors and Destructors
Constructors and DestructorsConstructors and Destructors
Constructors and Destructors
 
Java lec class, objects and constructors
Java lec class, objects and constructorsJava lec class, objects and constructors
Java lec class, objects and constructors
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in java
 
Chapter 2 Java Methods
Chapter 2 Java MethodsChapter 2 Java Methods
Chapter 2 Java Methods
 
constructor and destructor-object oriented programming
constructor and destructor-object oriented programmingconstructor and destructor-object oriented programming
constructor and destructor-object oriented programming
 
Constructor Overloading in java
Constructor Overloading in javaConstructor Overloading in java
Constructor Overloading in java
 
OCA JAVA - 1 Packages and Class Structure
 OCA JAVA - 1 Packages and Class Structure OCA JAVA - 1 Packages and Class Structure
OCA JAVA - 1 Packages and Class Structure
 
javaMethod.ppt
javaMethod.pptjavaMethod.ppt
javaMethod.ppt
 
Application of programming languages in civil engineering
Application of programming languages in civil engineeringApplication of programming languages in civil engineering
Application of programming languages in civil engineering
 
Java class 5
Java class 5Java class 5
Java class 5
 
Control Statements in Java
Control Statements in JavaControl Statements in Java
Control Statements in Java
 
Java API, Exceptions and IO
Java API, Exceptions and IOJava API, Exceptions and IO
Java API, Exceptions and IO
 
IMPACT OF IT IN CIVIL ENGINEERING
IMPACT OF IT IN CIVIL ENGINEERINGIMPACT OF IT IN CIVIL ENGINEERING
IMPACT OF IT IN CIVIL ENGINEERING
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
Inheritance
InheritanceInheritance
Inheritance
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 

Similar to Java constructors

Java Constructors with examples - Quontra Solutions
Java Constructors with examples  - Quontra SolutionsJava Constructors with examples  - Quontra Solutions
Java Constructors with examples - Quontra SolutionsQuontra Solutions
 
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSencha
 
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptxconstructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptxAshrithaRokkam
 
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its TypesMuhammad Hammad Waseem
 
Classes, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaClasses, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaRadhika Talaviya
 
Online java training ppt
Online java training pptOnline java training ppt
Online java training pptvibrantuser
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticLB Denker
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)arvind pandey
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in javaagorolabs
 
Advanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesAdvanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesJon Kruger
 
Python mocking intro
Python mocking introPython mocking intro
Python mocking introHans Jones
 

Similar to Java constructors (20)

Java Constructors with examples - Quontra Solutions
Java Constructors with examples  - Quontra SolutionsJava Constructors with examples  - Quontra Solutions
Java Constructors with examples - Quontra Solutions
 
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
 
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptxconstructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
constructorsfjy5ediykEASFul;IUWORHusi;gfb.pptx
 
Inheritance.ppt
Inheritance.pptInheritance.ppt
Inheritance.ppt
 
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types[OOP - Lec 13,14,15] Constructors / Destructor and its Types
[OOP - Lec 13,14,15] Constructors / Destructor and its Types
 
Classes, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with JavaClasses, Objects and Method - Object Oriented Programming with Java
Classes, Objects and Method - Object Oriented Programming with Java
 
Online java training ppt
Online java training pptOnline java training ppt
Online java training ppt
 
C Sharp Course 101.5
C Sharp Course 101.5C Sharp Course 101.5
C Sharp Course 101.5
 
java training faridabad
java training faridabadjava training faridabad
java training faridabad
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing FanaticDeveloper testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
 
Java Tutorials
Java Tutorials Java Tutorials
Java Tutorials
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
Oops
OopsOops
Oops
 
Advanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID PrinciplesAdvanced Object-Oriented/SOLID Principles
Advanced Object-Oriented/SOLID Principles
 
Namespaces
NamespacesNamespaces
Namespaces
 
Python mocking intro
Python mocking introPython mocking intro
Python mocking intro
 
Java
JavaJava
Java
 
Class introduction in java
Class introduction in javaClass introduction in java
Class introduction in java
 

More from QUONTRASOLUTIONS

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutionsQUONTRASOLUTIONS
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutionsQUONTRASOLUTIONS
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsQUONTRASOLUTIONS
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsQUONTRASOLUTIONS
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra SolutionsQUONTRASOLUTIONS
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classQUONTRASOLUTIONS
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutionsQUONTRASOLUTIONS
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction usQUONTRASOLUTIONS
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraQUONTRASOLUTIONS
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIQUONTRASOLUTIONS
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsQUONTRASOLUTIONS
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsQUONTRASOLUTIONS
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usQUONTRASOLUTIONS
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra QUONTRASOLUTIONS
 

More from QUONTRASOLUTIONS (20)

Big data introduction by quontra solutions
Big data introduction by quontra solutionsBig data introduction by quontra solutions
Big data introduction by quontra solutions
 
Cognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutionsCognos Online Training with placement Assistance - QuontraSolutions
Cognos Online Training with placement Assistance - QuontraSolutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Business analyst overview by quontra solutions
Business analyst overview by quontra solutionsBusiness analyst overview by quontra solutions
Business analyst overview by quontra solutions
 
Cognos Overview
Cognos Overview Cognos Overview
Cognos Overview
 
Hibernate online training
Hibernate online trainingHibernate online training
Hibernate online training
 
Java j2eeTutorial
Java j2eeTutorialJava j2eeTutorial
Java j2eeTutorial
 
Software Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutionsSoftware Quality Assurance training by QuontraSolutions
Software Quality Assurance training by QuontraSolutions
 
Introduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutionsIntroduction to software quality assurance by QuontraSolutions
Introduction to software quality assurance by QuontraSolutions
 
.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions.Net introduction by Quontra Solutions
.Net introduction by Quontra Solutions
 
Introduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training classIntroduction to j2 ee patterns online training class
Introduction to j2 ee patterns online training class
 
Saas overview by quontra solutions
Saas overview  by quontra solutionsSaas overview  by quontra solutions
Saas overview by quontra solutions
 
Sharepoint taxonomy introduction us
Sharepoint taxonomy introduction   usSharepoint taxonomy introduction   us
Sharepoint taxonomy introduction us
 
Introduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By QuontraIntroduction to the sharepoint 2013 userprofile service By Quontra
Introduction to the sharepoint 2013 userprofile service By Quontra
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 
Performance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutionsPerformance Testing and OBIEE by QuontraSolutions
Performance Testing and OBIEE by QuontraSolutions
 
Obiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutionsObiee introduction building reports by QuontraSolutions
Obiee introduction building reports by QuontraSolutions
 
Sharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra usSharepoint designer workflow by quontra us
Sharepoint designer workflow by quontra us
 
Qa by quontra us
Qa by quontra   usQa by quontra   us
Qa by quontra us
 
MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra MSBI and Data WareHouse techniques by Quontra
MSBI and Data WareHouse techniques by Quontra
 

Recently uploaded

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Java constructors

  • 1. Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com Quontra Solutions by Java Constructors
  • 2. Constructor • Constructor in java is a special type of method that is used to initialize the object • Java Constructor is invoked at the time of object creation • They do not contain any return type • Constructor name is same as class name Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 3. Types of Constructors • Default constructor (no-arg constructor) • Parameterized constructor Types of constructors Default constructor Parameterized constructor Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 4. Default Constructors Example for default constructor: class Cons{ cons(){ System.out.println("constructor is created"); } public static void main(String args[]){ Cons c=new Cons(); } } Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 5. Parameterized Constructors Example for parameterized constructor class Student4{ int id; String name; Student4(int i,String n){ id = i; name = n; } void display(){System.out.println(id+" "+name);} public static void main(String args[]){ Student4 s1 = new Student4(111,"Karan"); Student4 s2 = new Student4(222,"Aryan"); s1.display(); s2.display(); } } Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 6. Difference between constructor and method Constructor Method Constructor is used to initialize the state of an object. Method is used to expose behaviour of an object. Constructor must not have return type Method must have return type. Constructor is invoked implicitly. Method is invoked explicitly. Constructor name must be same as the class name. Method name should not be same as class name Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 7. Constructor Overloading • Constructors are methods that can be overloaded, just like any other method in a class. • Constructors having the same name with different parameter list is called constructor overloading. Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 8. Topics Covered during Training • Classes, Objects, Keywords, Methods • Exception Handling • String Handling • Multithearding • AWT • Swing • Applet • Collections • Hibernate • Struts etc……………… Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 9. Quontra Solutions Offers: Data Warehouse OBIEE, Cognos, Informatica Microsoft Courses C# .NET, ASP .NET, VB .NET & etc…. Programming Courses Core Java, Adv Java, J2EE, & etc…. Testing Tools Manual, QTP, Selenium, Load Runner Salesforce CRM Salesforce CRM, ADMIN, Developer Networking Courses Linux, Unix, Sun Solaris, CCNA Mobile Apps Android, IOS, Cloud Computing Data Base SQL PL/SQL, SQL server DBA, ORACLE 12C DBA Other Courses… Business Analyst, Hadoop, Qlikview
  • 10. Contact Us Call:(404)900-9988 Mail:info@quontrasolutions.com Visit:www.quontrasolutions.com Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com
  • 11. Follow us Facebook: https://www.facebook.com/quontrasolutionsusa Twitter : https://twitter.com/QuontraTraining Google+: https://plus.google.com/+Quontrasolutions/post Call : (404) 900-9988, (404) 990-3007, Mail Us: info@quontrasolutions.com