Author: Eric K

node date function 0

Creating Node.js Modules

Modules are javascript libraries that can be used in developing an application.They are set of functions. Types of Modules 1.Built in modules-these are node.js modules that can be used without installing them.Example of these...

Node.js hello world example 0

Getting Started with Node.js tutorial

Node.js is a Javascript framework that allows you to run javascript on server. Learning by examples. First of all make sure you have downloaded and installed node.js before getting started with this tutorial. Hello...

How to override Java Methods 0

How to override Java Methods

Overriding java methods happen in a case where a child class implements a method that is contained in super class.The main use of overriding is to provide a new implementation of a method. Overriding...

How to overload java methods by changing data type 0

How to overload java methods by changing data type

Below code shows how to overload java method by changing data type.See also Overloading java methods by changing the number of arguments.   public class MethodOverload { public void sumNumbers(int num1,int num2) { int...

How to overload java methods by changing number of arguments 0

How to overload java methods by changing number of arguments

The main reason why programmers overload methods are for easier readability.Think of a scenario where you have a method to multiply two numbers and another method multiply three numbers.These methods will have different names.Instead...

What is Aggregation in Java 0

What is Aggregation in Java

Aggregation in Java is very important because it makes code reusable.Think of a scenario where you’re creating a school-based management system.Student name, id, age are mandatory to be a caption in the system.Think of...

Multilevel Inheritance in  Java Example 0

Multilevel Inheritance in Java Example

In my previous post about Single level inheritance  I exampled how a child class can inherit methods from the parent class.Below code demonstrates, a more complex inheritance called Multilevel. public class Animal { void eat() {...

Simple Inheritance in Java 0

Simple Inheritance in Java

Below code shows a simple inheritance in java where class Dog inherits all class methods of parent class Animal. Animal Main Class public class Animal { void eat() { System.out.println(“All Animals eat”); } }...

Java program that takes two numbers as input  from a user and displays the product of two numbers. 0

Java program that takes two numbers as input from a user and displays the product of two numbers.

Below Java program code takes two integers from the user , multiplies  them and display import java.util.Scanner; public class JavaMultiply { public static void main(String args[]) { Scanner in = new Scanner(System.in); System.out.print(“Input first...

Java program to divide two numbers and print on the screen 0

Java program to divide two numbers and print on the screen

Below java program code divided two numbers and prints the output on the screen. /** * * @author Eric * site www.techoverload.net */ public class JavaDivide { public static void main(String args[]) { int...