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)

Strings in Java
Strings in JavaStrings in Java
Strings 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)
 
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
java.io - streams and files
java.io - streams and filesjava.io - streams and files
java.io - streams and files
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 
L21 io streams
L21 io streamsL21 io streams
L21 io streams
 
Java Streams
Java StreamsJava Streams
Java Streams
 
Java input
Java inputJava input
Java input
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Polymorphism In Java
Polymorphism In JavaPolymorphism In Java
Polymorphism In Java
 
Java collections concept
Java collections conceptJava collections concept
Java collections concept
 
java interface and packages
java interface and packagesjava interface and packages
java interface and packages
 
This keyword in java
This keyword in javaThis keyword in java
This keyword in java
 
Final keyword in java
Final keyword in javaFinal keyword in java
Final keyword in java
 
Inheritance in JAVA PPT
Inheritance  in JAVA PPTInheritance  in JAVA PPT
Inheritance in JAVA PPT
 
Java Collections
Java  Collections Java  Collections
Java Collections
 

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
 
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
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
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
 
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

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
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
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
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
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

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