1 / 6

Java Training Institute in Chennai

Java training institute in Chennai

vikram99723
Download Presentation

Java Training Institute in Chennai

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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.com CALL US +91 9940289059 Email:enquiry@accordittraining.com

More Related