Posts

Showing posts from October, 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

Abstraction in Java, How Abstraction works in java with example code

Image
Abstraction in Java, How Abstraction works in java with example  Class Objects & Methods Inheritance(IS-A) HAS-A Relationship Association Aggregation Composition Polymorphism Method Overloading Method Overriding Abstraction in Java (Security) Abstraction Data Hiding Encapsulation Tightly coupled Classes What is Abstraction abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it. How to achieve Abstraction Abstract Class (0-100 %) Interfaces (100 %) let's consider a Car, which abstracts the internal details and exposes to the driver only those details that are relevant to the interaction of the driver with the Car. For Complete Explanation in Hindi Please visit My Youtube Channel Thanks For Watching!!!

Interface in Java

Image
  Interface in Java What is Interfaces Another way to achieve abstraction in Java, is with interfaces. It’s a blueprint of a class, which tells by class what to do not how to do. An interface is a completely "abstract class" that is used to group related methods with empty bodies.  Features of Interfaces It is used to achieve abstraction. It supports multiple inheritance. It can be used to achieve loose coupling Like abstract classes, interfaces cannot be used to create objects Interface methods do not have a body - the body is provided by the "implement" class On implementation of an interface, you must override all of its methods Interface methods are by default abstract and public Interface attributes are by default public, static and final An interface cannot contain a constructor (as it cannot be used to create objects) Why and When to use Interfaces 1) To achieve security - hide certain details and only show the important details of an object (interface).

Loops in java With Example Code

Image
  LOOPS IN JAVA WITH EXAMPLE CODE In programming languages, loops are used to execute a set of instructions/functions repeatedly when some conditions become true. There are three types of loops in Java. for loop while loop do-while loop Java For Loop vs While Loop vs Do While Loop Java For Loop The Java for loop is used to iterate a part of the program several times. If the number of iteration is fixed, it is recommended to use for loop. There are three types of for loops in java . Simple For Loop For-each or Enhanced For Loop Labeled For Loop Example: 01. Simple For Loop //Java Program to demonstrate the example of for loop    //which prints table of 1    public   class  ForExample {   public   static   void  main(String[] args) {        //Code of Java for loop         for ( int  i= 1 ;i<= 10 ;i++){           System.out.println(i);       }   }   }  Output: 1 2 3 4 5 6 7 8 9 10 02.  For-each or Enhanced For Loop / /Java For-each loop example which prints the    //elem

Exception Handling in Java

Image
  Exception Handling in Java What is an Exception? An exception is an unwanted or unexpected event, which occurs during the execution of a program i.e at run time, that disrupts the normal flow of the program’s instructions. Error vs Exception Error:   An Error indicates serious problem that a reasonable application should not try to catch. Exception:   Exception indicates conditions that a reasonable application might try to catch. Exception Hierarchy All exception and errors types are sub classes of class  Throwable , which is base class of hierarchy.One branch is headed by  Exception . This class is used for exceptional conditions that user programs should catch. NullPointerException is an example of such an exception.Another branch, Error  are used by the Java run-time system(JVM) to indicate errors having to do with the run-time environment itself(JRE). StackOverflowError is an example of such an error. How JVM handle an Exception? Default Exception Handling  :  Wheneve