Mindblown: a blog about philosophy.
-
Data Types
In this tutorial, we will learn about all 8 primitive data types in Java with the help of examples. Java Data Types As the name suggests, data types specify the type of data that can be stored inside variables in Java. Java is a statically-typed language. This means that all variables must be declared before they…
-
Variables and Literals
In this tutorial, we will learn about Java variables and literals with the help of examples. Java Variables A variable is a location in memory (storage area) to hold data. To indicate the storage area, each variable should be given a unique name (identifier). Learn more about Java identifiers. Create Variables in Java Here’s how we…
-
Java JDK, JRE and JVM
In this tutorial, you will learn about JDK, JRE, and JVM. You will also learn the key differences between them. What is JVM? JVM (Java Virtual Machine) is an abstract machine that enables your computer to run a Java program. When you run the Java program, Java compiler first compiles your Java code to bytecode.…
-
Hello World Program
In this tutorial, you will learn to write “Hello World” program in Java. A “Hello, World!” is a simple program that outputs Hello, World! on the screen. Since it’s a very simple program, it’s often used to introduce a new programming language to a newbie. Let’s explore how Java “Hello, World!” program works. Java “Hello, World!” Program…
-
Java – Packages
Packages are used in Java in order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier, etc. A Package can be defined as a grouping of related types (classes, interfaces, enumerations and annotations ) providing access protection and namespace management. Some of the existing packages in Java…
-
Java – Interfaces
An interface is a reference type in Java. It is similar to class. It is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface. Along with abstract methods, an interface may also contain constants, default methods, static methods, and nested types. Method bodies exist only for…
-
Java – Encapsulation
Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be…
-
Java – Abstraction
As per dictionary, abstraction is the quality of dealing with ideas rather than events. For example, when you consider the case of e-mail, complex details such as what happens as soon as you send an e-mail, the protocol your e-mail server uses are hidden from the user. Therefore, to send an e-mail you just need to type…
-
Java – Polymorphism
Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object. Any Java object that can pass more than one IS-A test is considered to be polymorphic. In Java, all Java…
-
Java – Overriding
In the previous chapter, we talked about superclasses and subclasses. If a class inherits a method from its superclass, then there is a chance to override the method provided that it is not marked final. The benefit of overriding is: ability to define a behavior that’s specific to the subclass type, which means a subclass…
Got any book recommendations?