Add ImageIcon to a JLabel and center it

OutPut  

Read More


Write a function that takes an array of integers as an argument and returns a value based on the sums of the even and odd numbers in the array.

Write a function that takes an array of integers as an argument and returns a value based on the sums of the even and odd numbers in the array. Let X = the sum of the odd numbers in the array and let Y = the sum of the even numbers. The function should return X […]

Read More


Write a java function that accepts an integer array and returns 1 if it is a centered array, otherwise it returns 0.

An array with an odd number of elements is said to be centered if all elements (except the middle one) are strictly greater than the value of the middle element. Note that only arrays with an odd number of elements have a middle element. Write a java function that accepts an integer array and returns […]

Read More


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 save the file as  .js  file.Mine I saved as firstscript.js. Open […]

Read More


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

Read More


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 same name for the two methods. Example of overloading java […]

Read More