1 / 8

Java Training

35 Days Java Training Program is a Job oriented best Java Training Course. This training includes core java training, advanced java training plus 15 Days Free Android Training. Visit : www.asterixsolution.com/java-training.html

Download Presentation

Java Training

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 www.asterixsolution.com/java-training.html

  2. Introduction to Class in Java • Class is a template or blue print which is used to describe an object. • Class is one of the most important and misunderstood concept. • Class has got various definitions, • Class is user defined data type. • Class is an Abstract Data Type(ADT). • Class is collection of variables and methods.

  3. All the given definitions are really true but for a person who have just started to understand Java it becomes a bit tedious to understand. • Class is just a planning or a design on which object referring to it will be built upon. • Have you ever imagined why Fish cannot fly or Eagle cannot swim? • Answer is very simple because flying is not a characteristics of Fish and swimming is characteristics of Eagle. • If you understand this understanding concept of class will become more easier.

  4. Remember a class is made up of following content and all of the are optional, because if you try to do something like this.. • class Demo { } it will compile fine. So a class can be made up of, 1) Variables 2)Methods 3)Constructors 4)Inner Classes

  5. so assume for example if a class A contains certain methods m1(),m2(),m3(). • It will be only able to access those methods and not any other methods (Assuming class has not inherited any other class other that java.lang.Object) • So in simple words "AN OBJECT OF A CLASS CAN ACCESS ONLY THOSE METHODS WHICH ARE DEFINED INSIDE IT'S CLASS, NOTHING MORE OR NOTHING LESS".

  6. So as discussed, class Eagle does not have a variable fin and method swim() hence it cannot swim but same are the variables and methods of Fish, hence it can swim().Same way Fish does not have variable wing and method fly() hence it cannot fly, but same are the variables and methods of Eagle, so it can fly.Now let us have a look at technical aspect of Class.class is defined by a keyword classclass Fish{int fin;Fish(){System.out.println("Inside constructor of Fish");}public void swim(){System.out.println("Swim of Fish");}}

  7. Follow Us www.facebook.com/asterixsolutionlab www.plus.google.com/+Asterixsolutionlab

  8. To get more Online Java training, visit : www.asterixsolution.com/java-training.html Call : +91 771 503 6251 / +91 982 168 1514 

More Related