Java OOPs Concepts

The main OOPs Concepts in Java are as follows: 1. Abstraction: Abstraction is a way of hiding complexity. Let us take the example of a car. We know that if the accelerator is pressed, the speed will increase but don’t know the internal process of how speed will be increased. 2. Encapsulation: Encapsulation is a … Read more

Objects and Classes in Java

Before discussing the OOPs concepts let us have a brief look at objects and classes with real-world examples. Object in the Real world: Any real-world entity is known as an Object. Every real-world object/entity has two characteristics state and behavior. Let us take the example of a car. Its state is defined by color, current … Read more

Object-oriented programming style

OOPs is a style of computer programming that represents concepts as objects that have states and behaviors. e.g. objective-c, c#, Java. Difference between Object Oriented Programming and Procedural Programming.        Procedural Programming Object-Oriented Programming In Procedural Programming, a program is created in a step-by-step instructional format and instructions are executed in order. Follow a top-down approach. Less secure … Read more

Java Hello World Example

Let us start Java programming with the first simple Java program to print “Hello World”. As we already discussed in earlier tutorials, Java is an Object-oriented language so it requires writing code inside a class. Java Hello World Example: HelloWorld.java package com.w3schools; /** * This program will print “Hello World”. * @author W3schools360 **/ public … Read more

Naming Conventions in Java

Naming Conventions in Java refers to the guidelines that application developers are expected to follow so that they can produce consistent and readable code throughout the application. 1. Basic Naming convention standards To declare variables, constants, methods, classes, interfaces, etc use full descriptors. like customerId, firstName, lastName, etc. 2. Naming Packages The guideline for Package … Read more

JVM | Java Virtual Machine

What is JVM? JVM is a program or Virtual Machine that provides a run-time environment in which Java bytecode can be executed. JVMs are available for many software and hardware platforms. The same bytecode can be used on all JVMs for all platforms which makes Java platform independent. JVM diagram: JVM details: 1. Class loader … Read more

Features of Java | New Java Features

Java language has many useful features but the primary goal behind its (Java) creation was to enhance the portability and security of a computer language. Please find all important Java features below. Java features: 1. Familiar: Java is familiar because its syntax is based on C++. 2. Simple and Easy: Java is easy to learn … Read more