1 / 12

What is the use of class in Java training course?

Java is a most popular, robust, secure, platform independent and multithreading based high level programming language, because of this it is preferably used by many programmers

adityausit
Download Presentation

What is the use of class in Java training course?

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. What is the use of class in Java training course?

  2. Index • What is class in java? • How to use class in java?

  3. Java.long.Class is one of the most important classes in java, but mostly overlooked by Java developers. • It is very useful in the sense that it provides several helper methods, such as getClass (), forName() , which you can use to find and load a class. • Exltechis providing best Java training course in pune.

  4. It also provides methods like class.newInstance () is the backbone of reflection and allows you to create an instance of a class without a new () operator. • The class has no public constructor, and its instance is created by JVM when a class is loaded. The class class object is also used to represent classes, enum, interfaces, and annotations in a running Java application. • The primitive types such as byte, short, char, int, float, double, and boolean are also represented by class instances.

  5. You can use class literals, such as int, to use the appropriate class instance. • Great float.Class, or boolean.Class. It is also used to represent an instance of the array in Java. • Each array with the same type and dimension shares the same instance of the class class.

  6. Another use of java.long.Class implements the equals () method to check whether two objects are of the same type or not. • Java.long.Class class in Java • Each time JVM creates an object, it also creates a java.long.Class object that describes the type of object. All instances of the same class share the same class object and you can obtain the class object by calling the object's getClass () method. By the way, this method is inherited from java.long.Object class.

  7. Example of Class • For example, suppose you create two instances of the class named Person Z. • Person • A = new Person(); • Person B = new Person(); • if (A. getClass () = = B. getClass()){ • System.from.println ("A and B are instances of the same class"); • }else{ • System.from.println ("A and B are instances of different classes"); • } • In this case," A and B are instances of the same class " is printed because they are both instances of the Person class.

  8. We need forName() and newInstance () because we often know the name of the class to instantiate while writing code,we can get it from config files, database, network or from any upstream Java or C++ application. • https://www.exltech.in/java-training.html

  9. This is what we have called the reflective way of creating an object that is one of the most powerful features of Java and makes room for many frameworks ,such as Spring, Struts, which use Java reflection. • The object-oriented design principles are the core of OOP programming, but I have seen that most Java programmers hunt for design patterns such as Singleton pattern, Decorator pattern or Observer pattern and do not pay enough attention to Object-Oriented Analysis and design.

  10. To do my part, I have written down all the important object-oriented design principles and set it here for a quick reference. They give you at least an idea of what they are and what benefit they offer. • I don't have examples, only the article short, but you can find a lot of examples for these design principles in my blog, just use the search box at the top of the page.

  11. Read more: • https://www.exltech.in/

More Related