Constructor Non-Parameterized
Constructor Parameterized
Difference between Constructor and Methods
1. Constructor is mainly used to initialize the instance variable.
Whereas methods is used to expose the behavior of object.
2. Constructor is implicitly invoked, whereas method is explicitly
invoked.
3. These must not be any return type in Constructor but method
must have return type.
4. Constructor name must be same as class name but method
name may be same or different.
5. Constructor is implicitly provided by java Compiler if you
don’t specify any constructor in the java class, but method is
never provided by java Compiler.
Final Keyword
Method Overloading

More Related Content

PDF
The prototype property
DOC
Java classes and objects interview questions
PPTX
Polymorphism
PPTX
15reflection in c#
PPT
Super and final in java
PDF
6 class and methods
PPTX
When to use abstract class and methods in java
DOC
116824015 java-j2 ee
The prototype property
Java classes and objects interview questions
Polymorphism
15reflection in c#
Super and final in java
6 class and methods
When to use abstract class and methods in java
116824015 java-j2 ee

What's hot (11)

PDF
How prototype works in java script?
PPTX
Java Basics
PPTX
WHAT IS ABSTRACTION IN JAVA
PPT
Javascript design patterns
PDF
First order partial differential equations
PDF
Formation of partial differential equations by eliminating arbitrary functions
PDF
OOPs difference faqs- 2
PPTX
Java Chapter 04 - Writing Classes: part 1
PPTX
Object oriented programming in JavaScript
PPTX
C# Basics
PPT
Java interfaces
How prototype works in java script?
Java Basics
WHAT IS ABSTRACTION IN JAVA
Javascript design patterns
First order partial differential equations
Formation of partial differential equations by eliminating arbitrary functions
OOPs difference faqs- 2
Java Chapter 04 - Writing Classes: part 1
Object oriented programming in JavaScript
C# Basics
Java interfaces
Ad

More from Anuj Singh Rajput (20)

PPTX
Web technology
PPTX
Java script
PPTX
Html (hypertext markup language)
PPTX
PPTX
Jsp session 13
PPTX
Jsp session 12
PPTX
Jsp session 11
PPTX
Jsp session 10
PPTX
Jsp session 9
PPTX
Jsp session 8
PPTX
Jsp session 7
PPTX
Jsp session 6
PPTX
Jsp session 5
PPTX
Jsp session 4
PPTX
Jsp session 3
PPTX
Jsp session 2
PPTX
Jsp session 1
PPTX
Servlet session 14
PPTX
Servlet session 13
Web technology
Java script
Html (hypertext markup language)
Jsp session 13
Jsp session 12
Jsp session 11
Jsp session 10
Jsp session 9
Jsp session 8
Jsp session 7
Jsp session 6
Jsp session 5
Jsp session 4
Jsp session 3
Jsp session 2
Jsp session 1
Servlet session 14
Servlet session 13
Ad

Recently uploaded (20)

PPTX
growth and developement.pptxweeeeerrgttyyy
PPTX
IT infrastructure and emerging technologies
PPTX
Copy of ARAL Program Primer_071725(1).pptx
PDF
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
PDF
POM_Unit1_Notes.pdf Introduction to Management #mba #bba #bcom #bballb #class...
PDF
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
PPTX
Neurology of Systemic disease all systems
PDF
Chevening Scholarship Application and Interview Preparation Guide
PPT
hemostasis and its significance, physiology
PDF
Diabetes Mellitus , types , clinical picture, investigation and managment
PDF
Compact First Student's Book Cambridge Official
PDF
Physical pharmaceutics two in b pharmacy
PDF
Laparoscopic Imaging Systems at World Laparoscopy Hospital
PDF
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
PPTX
Thinking Routines and Learning Engagements.pptx
PDF
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
DOCX
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
PDF
Unleashing the Potential of the Cultural and creative industries
PPTX
Diploma pharmaceutics notes..helps diploma students
PDF
Review of Related Literature & Studies.pdf
growth and developement.pptxweeeeerrgttyyy
IT infrastructure and emerging technologies
Copy of ARAL Program Primer_071725(1).pptx
Horaris_Grups_25-26_Definitiu_15_07_25.pdf
POM_Unit1_Notes.pdf Introduction to Management #mba #bba #bcom #bballb #class...
GIÁO ÁN TIẾNG ANH 7 GLOBAL SUCCESS (CẢ NĂM) THEO CÔNG VĂN 5512 (2 CỘT) NĂM HỌ...
Neurology of Systemic disease all systems
Chevening Scholarship Application and Interview Preparation Guide
hemostasis and its significance, physiology
Diabetes Mellitus , types , clinical picture, investigation and managment
Compact First Student's Book Cambridge Official
Physical pharmaceutics two in b pharmacy
Laparoscopic Imaging Systems at World Laparoscopy Hospital
BSc-Zoology-02Sem-DrVijay-Comparative anatomy of vertebrates.pdf
Thinking Routines and Learning Engagements.pptx
Kalaari-SaaS-Founder-Playbook-2024-Edition-.pdf
EDUCATIONAL ASSESSMENT ASSIGNMENT SEMESTER MAY 2025.docx
Unleashing the Potential of the Cultural and creative industries
Diploma pharmaceutics notes..helps diploma students
Review of Related Literature & Studies.pdf

Constructor

  • 3. Difference between Constructor and Methods 1. Constructor is mainly used to initialize the instance variable. Whereas methods is used to expose the behavior of object. 2. Constructor is implicitly invoked, whereas method is explicitly invoked. 3. These must not be any return type in Constructor but method must have return type. 4. Constructor name must be same as class name but method name may be same or different. 5. Constructor is implicitly provided by java Compiler if you don’t specify any constructor in the java class, but method is never provided by java Compiler.