Saturday, February 2, 2013

Class in Java and Object oriented programming language - Video Tutorial

Class and Object are two pillars of Java programming language. There are multiple way you can describe Class in Java, for some one  Class is a user defined type, for others it's blueprint to create objects and for few of other it's just a way to model real world entity. Questions comes why do we need Class in Java, well one thing I can think of is to combine multiple types into one structure. Class and Object along with core OOPS concept e.g. Abstraction, Encapsulation, Inheritance and Polymorphism is first thing any Java programmer learn. I have just finished a basic Java presentation on Class for beginners which gives introduction of What is Class in Java and details some important details about Java Classes.


Class in Java - Things to know

What is Class and OOPS tutorial programming exampleFollowing are some key thing about Class in Java programming language for beginners : 

1) Class is represented using class keyword
2) There are two kinds of class, top level and nested class in Java.
3) According to Java convention, name of class should start with capital letter.
4) Unlike C structures which is analogous to class, Java classes can contain not only variables but also methods which operate on those fields.
5) Class is the smallest unit of modular code, functionality in Java is presented in terms of class.
6) As per SRP (Single Responsibility Principle)  SOLID design principle, a class should only represent one thing and there should not be more than one reason to change a class. Well designed classes are key for loosely coupled and modular code in Java.
6) Class doesn't do anything special, it's just defined structure and object do all the things.

See my presentation on What is class in Java for more details



That's all on What is Class in Java programming language, there are lot more details which we will discuss in further post.  Best way to learn Class and Object is to model some real world things e.g. Person, Student, Employee etc.

Related Java and OOPS programming Tutorials
What is abstraction in Java programming language
What is Encapsulation in Java with Example
What is polymorphism in Java? method overloading or overriding
What is Inheritance in Java with Example
Difference between Abstraction and Encapsulation in Java

1 comment:

  1. Nice explanation & specially videos are very beneficial

    ReplyDelete

Java67 Headline Animator