Data Structure Definition Java

What is Data Structure?

Data Structure in javaData Structure,

first of all lets break it down to pieces : Data and Structure.
What is a data? Googling on the internet said :

Philosophy “things that is probably known or assumed as facts, making the basis of reasoning or calculation”.
                    Computing “the quantities, characters, or symbols on which operations are performed by a computer, being stored and transmitted in the form of another electrical signals and recorded on magnetic, optical, or mechanical recording media

Continue reading Data Structure Definition Java

Java Modifiers Types Definition

Java Modifiers Types

So, folks.. first of all what goes through your mind when you hear “modify”, well for me when I hear that word the simplest meaning is to “change”. So what is a modifier, basically modifiers (In java) are a keywords that you can add to those definitions to change their meanings. In the java language there are a wide range of variety for java modifiers types, including the following modifiers :

  • Java Access Modifiers 
  • Java Non Access Modifiers

Continue reading Java Modifiers Types Definition

Multi Threading Programming (Java)

Multi Threading Programming In Java

What is the multi threading programming that we used is Java, hear this.. Java is actually a multi-threaded programming language and by that Java can let us develop a multi-threaded program.

Do you know what a multi-threaded program is? well a multi-threaded program contains two or more than two parts. Which runs concurrently and each of that one part can handle different task (i.e codes that contains methods, constructors etc) at the same equal time. This can actually improves the optimal use of the available resource, if you have multiple CPUs.

Basically multi threading programming takes the idea of multi tasking. Which is “doing more than 1 activities at the same time”. Multi tasking in our terms it means when a multiple processes share a common process resource such as a CPU.
Continue reading Multi Threading Programming (Java)

Code Aggregation *for code reusability

What is Code Aggregation

code aggregation
Code aggregation as reusability

If there is an entity reference in a class, then you what you have is a code aggregation. Aggregation usually represents HAS-A relationship.
Consider the following situation situation.

A Worker object contains many informations such as id, name, phone number etc. It contains one more object named address, which contains its own informations such as city, state, country etc. see it as given below.

Continue reading Code Aggregation *for code reusability

Java JSpinner & Its Definition

What is Java JSpinner

Okay lads, today we’re talking about Spinner. But hey! it’s not a fidget spinner that we’re talking. Because It is a Java JSpinner and JSpinner allows the users to select a number or an object value from an already sequence using single line input.

The Syntax :
public class JSpinner extends JComponent implements Accessible  

First of all here are common constructor of Java JSpinner:

  • JSpinner() : This class is used to construct a spinner with an Integer SpinnerNumberModel and in addition of an initial value of 0 and with no minimum or maximum limits.
  • JSpinner(SpinnerModel model) : This is another one of Java JSpinner that is used to construct a spinner for a given model.
Especially relevant here are common methods ofmJava JSpinner :


  • void addChangeListener(ChangeListener listener) : This method is used to add another listener to the list which will be notified each time a change to the model occurs.
  • Object getValue() :While this method is used to return the current value of the model.
Finally It’s Exmpl time! :
import javax.swing.*;    
public class SpinnerExample {  
    public static void main(String[] args) {    
    JFrame f=new JFrame(“Not Fidget Spinner”);    
    SpinnerModel value =  
             new SpinnerNumberModel(10, //initial value  
                0, //minimum value  
                20, //maximum value  
                2); //step  
    JSpinner spinner = new JSpinner(value);   
And This will output :

ForEach() Method : Lambda Expressions & Method Reference

Definition of ForEach() Method

ForEach() Method

Due to Java 8 new features, that provides us java coders a method named forEach() to iterate the elements. forEach() method is defined in iterable and Stream interface. The collection classes which is the one that extends the iterable interface can use forEach loop to iterate elements. As a result you can pass lambda expressions as an argument in this method because it takes a single parameter which is a functional interface.

Continue reading ForEach() Method : Lambda Expressions & Method Reference

Java Split Method

What Is Java Split Method?

programming Java, Java Split Method
Programming Java

There’s a method in java that is used to “split” string into pieces, the split is based on a given regular expressions and a return char array. There are 2 type of syntax that can be used for Java Split Method, (for a fun fact java split method is available since java 1.4).

Continue reading Java Split Method

Java Strictfp Keyword

Java Strictfp Keyword

Java strictfp keyword may sound odd to you, because at first I do as well. But strictfp is a java keyword that will ensure your result will and always be the same on every platform if you do an operation in the floating point variable. The result of an operation in the floating point variable may differ to each and every platform you use, and by that java programming language provide the strictfp so you’ll get the same result on every platform. Also by having strictfp you have more control over floating point arithmetic.

Usable java strictfp keyword syntax

The strictfp can be used methods, classes and interfaces.
A : class Example{
A : strictfp void Example(){ //strictfp applied on methods}}
B : strictfp Example{ //strictfp applied on classes}
C : strictfp interface Example{ //strictfp applied on interface}

Unusable strictfp keyword syntax

The java strictfp keyword can not be used in abstract method, variables or constructors.
A : class Example1{
A : strictfp int value = 10; //it is not usable in variables i.e integer}
B ; class Example2{
B : strictfp abstract void example(); //it is not usable in abstract methods}
C : class Example3{
 C : strictfp Example(){} // it is not usable in constructors}

Java Covariant Return Type = Method Overriding

What Is Java Covariant Type?

Howdy Mowdy People? Have you ever override a method by changing its return type? Well for y’all that is already a pro in Coding may know this type of overriding, but for those who is still  a green horn in coding, just like me :’D maybe. This kind of method overriding is called Java Covariant Return Type, which is not available until Java5 came out.

Here ok, let me just show you a simple presentation of this Covariant Type :

Continue reading Java Covariant Return Type = Method Overriding