Mindblown: a blog about philosophy.

  • Compute Quotient and Remainder

    In this program, you’ll learn to compute quotient and remainder from the given dividend and divisor in Java. Example: Compute Quotient and Remainder Output: In the above program, we have created two variables dividend and divisor. Here, we are calculating the quotient and remainder by dividing 25 by 4. To find the quotient, we have…

  • Multiply two Floating Point Numbers

    In this program, you’ll learn to multiply two floating point numbers in Java, store the result and display it on the screen. Example: Multiply Two Floating-Point Numbers Output In the above program, we have two floating-point numbers 1.5f and 2.0f stored in variables first and second respectively. Notice, we have used f after the numbers. This ensures the numbers are float, otherwise they will be assigned…

  • Add Two Integers

    In this program, you’ll learn to store and add two integer numbers in Java. After addition, the final sum is displayed on the screen. Program to Add Two Integers Output: In this program, two integers 10 and 20 are stored in integer variables first and second respectively. Then, first and second are added using the + operator, and its result is stored in another variable sum. Finally, sum is printed on the…

  • Hello World

    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 Output How Java “Hello, World!” Program Works? // Your First Program In Java,…

  • Wrapper Class

    In this tutorial, we will learn about the Java Wrapper class with the help of examples. The wrapper classes in Java are used to convert primitive types (int, char, float, etc) into corresponding objects. Each of the 8 primitive types has corresponding wrapper classes. Primitive Type Wrapper Class byte Byte boolean Boolean char Character double Double float…

  •  File Class

    In this tutorial, we will learn about Java File and its various operations with the help of examples. The File class of the java.io package is used to perform various operations on files and directories. There is another package named java.nio that can be used to work with files. However, in this tutorial, we will focus on the java.io package. File and Directory…

  • Java Generics

    In this tutorial, we will learn about Java Generics, how to create generics class and methods and its advantages with the help of examples. The Java Generics allows us to create a single class, interface, and method that can be used with different types of data (objects). This helps us to reuse our code. Note: Generics does…

  • Lambda Expressions

    In this article, we will learn about Java lambda expression and the use of lambda expression with functional interfaces, generic functional interface, and stream API with the help of examples. The lambda expression was introduced first time in Java 8. Its main objective to increase the expressive power of the language. But, before getting into…

  • Auto boxing and unboxing

    In this tutorial, we will learn about Java autoboxing and unboxing with the help of examples. Java Autoboxing – Primitive Type to Wrapper Object In autoboxing, the Java compiler automatically converts primitive types into their corresponding wrapper class objects. For example, Autoboxing has a great advantage while working with Java collections. Example 1: Java Autoboxing Output In…

  • Type Casting

    In this tutorial, we will learn about the Java Type Casting and its types with the help of examples. Before you learn about Java Type Casting, make sure you know about Java Data Types. Type Casting The process of converting the value of one data type (int, float, double, etc.) to another data type is known as typecasting. In…

Got any book recommendations?