Category: Java

Tutorial on casting in Java 0

Casting in Java

Casting is not the most interesting subject in programming, but it is nevertheless very important to be familiar with it. In this article I’ll give you a quick introduction to casting in Java, as well as some examples on how to use casting in Java. What is casting in Java?...

Java naming conventions 0

Naming conventions in Java

There is no doubt about it; no matter how good of a Java developer you are, your code will look kind of ridiculous if you don’t know the naming conventions in Java! But what exactly are the so-called naming conventions in Java? In this article we’ll cover the most common...

Declaring and using variables in Java 0

Declaring and using variables in Java

Declaring and using variables is one of the most fundamental aspects of programming. In this tutorial you’ll learn how to declare and use variables in Java! What is a variable in Java? Simply put, a variable is nothing more than a name for a memory location. Think of a variable...

Bugs in programming code 0

5 ways to find bugs in your code

Bugs.. I’m not talking about natural bugs you find outside. No, I’m talking about something far more sinister.. bugs in your code. No matter how good you are, or how hard you try, you’ll almost always encounter some bugs in one form or the other. Some bugs are easy to...

Explaining of to define constants in JAva 0

How to define constants in Java

There seems to be a lot of confusion around the topic of constants in Java. Some people make use of integers or strings to define constant, while other make use of enums. I’ve also come across constants defined in their own interface – where classes which make use of the...

Reference types in Java can be null 0

Java StringJoiner tutorial

I recently came across the Java StringJoiner class, and I gotta tell you: It is a whole lot better than StringBuilder! The beauty of the StringJoiner is that you can define a delimiter, which will be added each time you call the StringJoiner#add(String) method. You can also provide a prefix and a suffix, which...

Java SE 8 Optional Class 0

Short Java 8 Optional Tutorial

If you’ve been programming with Java for some time, I am quite sure that you’ve heard of or first-hand experienced the NullPointerException.A NullPointerException occurs when the programmer (you..) try to perform some operation on a variable that hasn’t been assigned any value – hence, it is null. The Java 8...

Two reference types can point to the same memory location in Java 0

Java reference types

Reference types in Java are all the types that are not one of the primitive types. Primitive types are the most basic data types in Java – the only purpose of these types are to store simple values of one kind. The 8 primitive data types in Java are: short...

Client Server Application using Java Server & ServerSocket tutorial 0

Java Socket & ServerSocket Tutorial

In this article you will learn how to program a very basic Client-Server application. The communication between the client and the server will be unidirectional. Said in other words, there will only be a one-way communication between the client and the server. We’ll also write some very simple tests alongside with this...

Difference between abstract class and interface in Java 0

Difference between abstract class and interface in Java

If you’re somewhat new to Java, you might have wondered what’s the difference between an abstract class and an interface. They sure pretty much seem like the same thing, right? The interface in Java Interfaces are commonly used when you want to decouple the the interface from the implementation. Said in other words, an interface...