Java Training Institute in Chennai - PowerPoint PPT Presentation

About This Presentation
Title:

Java Training Institute in Chennai

Description:

Java Training Institute in Chennai – PowerPoint PPT presentation

Number of Views:19
Slides: 7
Provided by: vikram99723

less

Transcript and Presenter's Notes

Title: Java Training Institute in Chennai


1
Java Training Institute in Chennai
2
Java classes and objects
  • Java is a object oriented programming language
  • Everything in Java associated with classes and
    objects, along with its attributes and methods.
    For example in real life car is an object.
    Weight and color is attribute of car and drive
    and brake is method of car.
  • A class is like an object constructor, or a
    blueprint for creating objects.

3
Create a Class
  • To create a class, use keyword class
  • Create a class called MY CLASS with a variable
    x.
  • Public class my class

4
Create an Object
  • In Java, object is created from class. We have
    already create the class name MYCLASS, so now we
    can use this to create objects.
  • To create an object of MYCLASS, specify the class
    name, followed by the object name, and use the
    keyword new

5
Using Multiple Classes
  • You can also create an object of a class and
    access it in another class. This is often used
    for better organization of classes.
  • Remember that the name of the java file should
    match the class name. In this example, we have
    created two files in the same directory/folder
  • MyClass.java
  • OtherClass.java

6
  • CONTACT US
  • www.accordittraining.c
    om
  • CALL US 91 9940289059
  • Emailenquiry_at_accordittraining.com
Write a Comment
User Comments (0)
About PowerShow.com