Java | Constructor vs. Method

If you are within your first year of application development in Java you may have asked yourself this question. I know I did.

What is the difference?

Java

Here is a reference list that I have compiled for your convenience.

Download the excel file and build upon other comparisons you need to keep track of –>constructor-vsmethods.xlsx

Topic

Constructors

Methods

Purpose

Create an instance of a class – Object Initialization Grouped Java statements – Each performs a small unit or task

Modifiers

No – Cannot be abstract, final, native, static, or synchronized, already marked as final & static. Yes – Can be abstract, final, native, static, or synchronized

Has a Return type

No – not even void Yes – void or a valid return type

Naming Convention

Same name as the class, first letter is capitalized by convention) — usually a noun Any name except the class. Method names begin with a lowercase letter by convention — usually the name of an action

Inheritance

No – Constructors are not inherited Yes – Methods are inherited

Compiler automatically supplies a default constructor

If the class has no constructor, a no-argument constructor is automatically supplied Does not apply

Compiler automatically supplies a default call to the super-class constructor

If the constructor makes no zero-or-more argument calls to super, a no-argument call to super is made Does not apply

Can be Overloaded/Overwritten?

Yes Yes

Can be public, protected, private?

Yes Yes

Must be same name as Class?

Yes No, arbitrary

chained and they are called in a particular order

Yes No

Develope a Web Based CMS Using PHP

Download this File Here

Abstract
The Content Management System (CMS) is a web based application using a Linux Server,
Apache Web-server, MySQL Database, and PHP Programming Language (LAMP). The
objective of managing users, and information in any given network environment can only be
hindered by the creativity of an information technology professional and not by technology. The
main objective of this thesis is to develop the early development steps of a LAMP software bundleCMS. By creating the
building blocks for developing, and taking into consideration basic methods for creating the core
platform of a CMS for further development. All information gathered, and experience gained will
assist with developing and offering my own personal e-commerce business solutions in the future
and to obtain additional business and practical knowledge in an open source software and ecommerce.
Continue reading