Posts

Showing posts from 2018

OOPs Concepts in Java

Image
There are 4 OOPs concepts in java: Inheritance Encapsulation Abstraction Polymorphism Inheritance:   This is a special feature of Object Oriented Programming in Java.Inheritance called when child class acquires all properties and behaviors of parent class or superclass.        Class Super{                 .....                 .....        }          Class Base extends Super{                         .....                 .....        } Encapsulation:  Encapsulation in Java is a mechanism for wrapping the data (variables) and code act on the data(methods) together as a single unit. For ex. capsule                          The  Java Bean  class is the example of fully encapsulated class.                                                                                                                                                           An advantage of Encapsulation in java: By providing Getter and Setter methods we can make that class ad read-on

How to create Dynamic Web Maven project in STS(Spring Tool Suite) or Eclipse

Image
What is Maven? Maven is mostly used in the world.Inventor of maven was apache.It is apache based technology. Maven is a powerful  project management tool  that is based on POM (project object model). It is used for projects build, dependency and documentation. Maven’s Objectives Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with: Making the build process easy Providing a uniform build system Providing quality project information Providing guidelines for best practices development Allowing transparent migration to new features Tools Needed: Eclipse EE or STS(Spring Tool Suite) Maven JDK 1.9 Assumption: You have setup Maven  and  Apache Tomcat  Server successfully in your Eclipse or STS  Environment . Step-1:             File -> New -> Project... Select Maven Pro

Differentiate JDK, JRE and JVM

Image
                                      JDK(Java Development Kit):         The Java Development Kit(JDK) is a software development environment used for developing Java application and also in applets. It contains JRE(Java Runtime Environment), compiler(javac), an archieve(jar file), documentation generation(javadoc) and many other tools in java development.It is physically exist and it is combination of JRE and development tools.   JRE(Java Runtime Environment):        Java Runtime Environment(JRE) is we say JAVA platform, All Java programs to run under the JRE. Includes JVM and JAVA core libraries and supporting files. It dows not include development tools - compilers, debuggers, and other tools, as compared to the JDK. JVM(Java Virtual Machine):    Java Virtual Mechinal (JAVA  virtual machine  )  .  JVM is  part  of the  JRE  , it is a fictional computer, through the actual computer simulation of a variety of computer functions to achieve.  JVM  has its own complete hardw

Class and Objects in Java

Image
A class is describe the state and behaviour that objects of its type supporte.In above image is of spunchbob and chota bheem.Both are individual objects and both have its own methods. There are 5 things to creates a class:   1. Modifiers: Keywords like public,private,protected,default. (click here for refer in details).   2. Class Name : Any name with camel case.(click here for refer in details).   3. Super Class : If class extends super class then proceed by keyword extends   and then superclass           name . It can be Abstract class also.Class can be extend only one class.   4: Interface: It can be using by keyword implements. One class can be implements more then one.   5: Body: It surrounded by using {} brackets.    The class is declare as:                         public class Bheem{                         public void Eyes(){                        .......                                      }                              .........