Home Java Training Video Tutorial - Classes and Objects in Java
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Video Tutorial - Classes and Objects in Java

Advertisement
Learn Java Classes and Objects programming concepts through video tutorial. Learn how to create Classes and Objects in Java.

Video Tutorial on Classes and Objects in Java teaches you with example code

In this video tutorial you will learn about Classes and Objects in Java. This video tutorial on Classess and Objects teaches you with an example code. You will learn what are Classes and Objects in Java program. You will also learn how to create classes in Java and the create the instance of class in your program.

Here, we will explain how to declare classes and objects in you programs with syntax and examples. This Classess and Object online video tutorial of roseindia.net explain the the core concept of Classes and Objects in Java program with step by step process.

In Java classes is the blueprint of the real world object. For example you can have a class for Car with will have the properties in the form of variables and operations of the class in the form of methods.

In Java class source code file is simple text file with .java extension. When this java file is compiled it is converted to the byte code file which is saved with the .class extension.

Here is the video tutorial on Classes and Objects in Java:

The objective of the this tutorial is to provide the easy to learn and understand explanation of Class and Object concept in Java.

classes-objects

Welcome to java tutorial series. In this lesson, you will learn about Classes and Objects in Java that covering the topics below:

  • Object Oriented Programming(OOP's)
  • Classes in Java
  • Classes and Objects

In this video tutorial we will be covering the above topics i.e. Object Oriented Programming(OOP's), classes in Java programming and lastly the concepts of classes and objects in Java programming language. Here, you will find what is Classes and Objects. You will learn what is Object Oriented programming(OOP's) Concepts as well as what is classes in Java programming language and how to declare these objects and classes in your program. Let us discuss one by one of these concepts in elaborate manner.

classes-objects-topics

Object Oriented Programming(OOP's)

Before going into the Java programming let us know what is Object Oriented programming(OOP's). The Object oriented programming(OOP's) supports object based approach and objects data structure having attributes and methods.

object-orient-programming

Here we explain some of the key points of object-oriented programming in Java are:

Object-orient-programming

  • Object Oriented Programming (OOP) is the nucleus of Java. As it's name says, this approach of programming is object-oriented means object based. The object is a data structure that has attributes and methods.
  • Object is the instance of the class, which has 'behavior', and 'states' or we can say 'properties' in other words. For example, lion has states like color, breed etc and also have behaviors like-growling, roaring etc.
  • If you look around, you will find many live examples of objects like humans, bikes, cars, dogs etc. Humans can have many states like name, complexion, nationality etc and the behaviors like talking, walking etc.
  • Java objects have very similar characteristics like real word objects having a state and behavior. A java object's behavior is shown via methods and its state is stored in fields.
  • Object to object communication is done through methods and methods operates on object's internal state.

object-orient-programming

Classes in Java

In java programming language a class determined as a template or blue print that describes the behavior/states that object of its type support. Here we will describe a sample of class program with example.

classes-in-java

A class can be defined as a template/ blue print that describes the behavior/states that object of its type support. In other words - A class is a blue print from which individual objects are created.

Object is the instance of the class, which has 'behavior', and 'states' or we can say 'properties' in other words. For example, lion has states like color, breed etc and also have behaviors like-growling, roaring etc.

A sample class Lion is shown on your screen.

Objects in Java

objects-in-java

Object is the instance of the class, which has 'behavior', and 'states' or we can say 'properties' in other words. For example, lion has states like color, breed etc and also have behaviors like-growling, roaring etc.

defination-objects-in-java

Java objects have very similar characteristics like real word objects having a state and behavior. A java object's behavior is shown via methods and its state is stored in fields. Keyword 'new' is used to create new object.

object-classes-example

Output of given programs comes as below:

output-of-object-class

You need to follow the following steps to create an object:

object-classes-proceding

First, You need to declare object using a variable name and type of the objects as: Mainclass mc;

classes-objects-main-class-code

Here Mainclass is the name of the class.

classes-objects-main-class

classes-objects-main-class

Second step is instantiation of object using new key word as:-

classes-objects-main-class

classes-objects-main-class

mc = new Mainclass();

command-prompt-mode

Complete code is given on your screen in which the object of class is created. And using this object, functions of the class is called.

java-mainclass-comd-code

java-mainclass-comd-code-

You can compile and execute your class as shown on your screen.

java-mainclass-comd-code

java-mainclass-comd-code

java-mainclass-comd-code

java-mainclass-comd-code

Classes-objects-video-Finish

View more video tutorials at http://roseindia.net/java/training/index.shtml

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 27, 2013

Related Tutorials

Ask Questions?    Discuss: Video Tutorial - Classes and Objects in Java  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com