node date function

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 modules are:- http-makes node.js act like http server. https-makes node.js act…

Node.js hello world example

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 word node.js application. Code

How to  run above code First…

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 Java methods can take place if only:- Child class and parent…

How to overload java methods by changing data type

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.  

Output

How to overload java methods by changing number of arguments

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 of using different names, java overloading allows us to use the…

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 a student address.Student address will contain student state, city, zipcode etc.…

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.

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

Dog child class

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

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.