Posts

Showing posts from July, 2020

Advanced Java Programming

Image
                          Advanced Java Programming Advanced Java Programming :-   Introduction to advance java   As most of us already know that if we want to make normal applications it  can be easily built using core Java concepts. But, when it we need to develop web applications, advanced Java fundamentals, like JSP, Servlets, JDBC etc. needed, so to add capabilities and features of the application advance java is essential for developers. Through the motive of this blog is to explain about Advanced Java, I will be giving you a complete insight into the fundamental concepts of Advance Java. Figure - 1.2 If you want to see complete video on this please  have a look the video below.                              Learn with Resh u Advanced Java Programming Course Figure - 1.3 I hope you understood by the slide why Advanced Java is essential. For your better understanding, I have divided this article int

Encapsulation in java

Image
      Encapsulation in java Encapsulation The meaning of  Encapsulation , is to make sure that "sensitive" data is hidden from users. To achieve this, you must: declare class variables/attributes as  private provide public  get  and  set  methods to access and update the value of a  private  variable Get and Set You learned from the previous blogs that  private  variables can only be accessed within the same class (an outside class has no access to it). However, it is possible to access them if we provide public  get  and  set  methods. The  get  method returns the variable value, and the  set  method sets the value. Syntax for both is that they start with either  get  or  set , followed by the name of the variable, with the first letter in upper case: Example package com.encapsulation.examples; public class MyEncapsulation { private String name; private String idNum; private int age; public String getName() { return name

Polymorphism in Java Method Overriding and Method OverLoading in Java

Image
Polymorphism in Java  Method Overriding and  Method OverLoading in Java Java Polymorphism Polymorphism means "many forms", and it occurs when we have many classes that are related to each other by inheritance. Like we specified in the previous Blog; Inheritance lets us inherit attributes and methods from another class.  Polymorphism  uses those methods to perform different tasks. This allows us to perform a single action in different ways. Polymorphism are two types Method Overriding : It calls as compile time polymorphism or static or early binding.   Method Overloading: It calls as Runtime polymorphism or dynamic or late binding. For example, think of a superclass called  Animal  that has a method called  animalSound() . Subclasses of Animals could be Pigs, Cats, Dogs, Birds - And they also have their own implementation of an animal sound (the pig oinks, and the cat meows, etc.): This is a example of Method overriding in Polymorphism .