All about Interfaces and Abstract classes In Java:
As we have discussed and understood this earlier, Java is an object-oriented programming language and a Class is like an object constructor, or say a “blueprint” for creating objects [i.e.group of similar objects]. So coming down to understanding why classes are needed in Java? Putting it short, classes help us take all the properties and behaviours of an object in our program, and combines them into a single template. Having said that, a class in Java is simply a template for creating objects of similar attributes and behaviour.
Constructors are basically the mould to objects. They give the object its shape and meaning. They are particularly useful for initializing the object with default values.
Let’s begin this read by understanding on what are constructors and what is it that makes it different from any other method in Java. A constructor in Java is similar to a method which gets invoked when an object of a class is created. In other words, we can say a constructor is a special method that is called when an object is instantiated, i.e. when we use ‘new’ keyword. The purpose…
We will be looking into one of the most primary concept of Java — the OOPs concept. Basically, Java OOP concepts lets us create working methods and variables, then re-use all or part of them without compromising security.
Object Oriented Programming is a programming paradigm that relies on the concepts of classes and objects. Java is a class-based object-oriented programming (OOP) language that is built around the concept of objects. OOP concepts intend to improve code readability and reusability by defining how to structure a Java program efficiently. The main principles of object-oriented programming are: Abstraction, Encapsulation, Inheritance…
Keeping it simple to understand I will be covering here just a basic walkthrough on what a memory allocation in Java is all about? As we all are aware that a JVM is an abstract computing machine which enables a computer to run a program. The JVM loads the code, verifies it, executes it, manages the memory[allocating memory from OS, managing Java allocation including heap compaction and garbage collection] and provides the runtime environment.
Memory allocation being a part of JVM [Java Virtual Machine]. So understanding why Java needs a JVM and no other languages needs a VM…
Sorting is any process which involves arranging of items(data) systematically holding two common yet distinct meanings to it :
ordering: arranging the items in a sequence ordered by some given criterion
categorizing: grouping the items which holds similar or alike properties.
The importance of sorting lies in the fact that the data searching can be optimized to an extreme high level.
A very common thing that comes to a developers’ mind is why study sorting when languages like C, C++, Python, Java already has built-in sorting algorithms written ….. To bring it to your notice, Lets us understand…
Let us try and understand today what are the basic definitions we should be aware of in order to write a code template in Java. It is very essential to be clear in understanding the syntax of any language given to us. Syntax typically refers to a structured form of code that any computer could interpret. If a user tries to execute a command or say block of code without a proper syntax, it will end up generating syntax error, usually causing the program run to fail. In the most basic terminology I would refer a syntax to be the…
As the name suggests, a control statement is a statement which determines whether or not the other statements of a program will be executed. It basically controls the complete flow of a program.
Today we are looking forward to discussing one of the fundamental topics in any programming language. This article will give you a brief explanation on what are control statements and how they control the flow of execution of any program. Starting with giving you all an overview of the categories of a control statement. The control statement is broadly categorized into three statements
I have assembled these topics into this single article, as they are interlinked with each other’s definitions and hold better explanations when put together. Also I as a publisher would never like my readers to remain in any sort of a dilemma while reading the articles which I intend to write to make things and concepts look little lesser complex to you all out there.
So to begin with, let us understand a basic terminology of what these words actually mean, and as we proceed further we will dive deep into their classifications and usages in Java.
Today while being interviewed as a candidate for a SDE II role in a reputed organization, I was asked a very simple yet another important question for what do you know about a heap memory and Garbage collection in Java? Although I was fairly able to explain the concept, a thought prevailed for letting you all know about what a heap memory is and what should you typically answer it like, when questioned in an interview!
To begin with, irrespective of you being aware or unaware of what does Java Heap Memory actually functions like. I would like…
As we have gathered to feed on some very basic yet another important topic today, lets do the talking about what a Keyword in Java is? … let us understand that a keyword is precisely any reserved word that holds a specific predefined meaning to it in a language.
I will be mentioning here the list of Java Keywords.[tip: don’t try memorizing this stuff, its just for making you familiar with what are their usages]
Software Development Engineer | Java | Object Oriented Programming | Multi threading | Data Structures and Algorithms | Design Patterns