Kotlin Hello World – Your First Kotlin Program In this article, you will learn to write Hello World program in Kotlin. 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. Let’s explore how “Hello, World!” program …
Day: May 2, 2021
Java Program to Create a immutable class In this example, we will learn to create an immutable class in Java. Example: Java program to create immutable class final class Immutable{ private String name; private int date; Immutable(String name, int date) { // initialize the immutable variables this.name = name; this.date = date; } // …
Java Program to Create custom exception In this example, we will learn to create custom checked and unchecked exception in Java. Example 1: Java program to create custom checked exception import java.util.ArrayList; import java.util.Arrays; // create a checked exception class class CustomException extends Exception{ public CustomException(String message){ // call the constructor of Exception class …