Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Blog Directory  >  Software Blogs  >  Programming Blogs  >  JavaDevNotes programming Blog  > 

Javadevnotes Blog


javadevnotes.com
A website dedicated to sharing code examples for newbie Java developers
2019-09-30 16:00
Groovy is called Groovy for a reason - it is a factory of fun and intuitive way of programming. Case in point? The Groovy String take method is a method that is implemented because the nam… Read More
2019-09-15 16:02
We love to work with arrays because they are simple yet very powerful data structure in Java Language. It is also very intuitive and easy to use. If our needs does not require too much dyn… Read More
2019-09-15 16:00
We love to use arrays as it is a very simple data structure to create and manipulate. In fact, such data structure exists in much older programming languages. Sometimes we just don't need… Read More
2019-09-06 12:05
In this post we tackle another difficult program to solve that, is determining if a number is a palindrome. Below is the code to solve that. That is Determining Palindrome number in Java u… Read More
2019-09-06 12:01
It is a very good exercise to improve our logic and we wish to solve some problems. And so in this post we try to give example on how to solve this problem, determining Armstrong number in… Read More
2019-09-06 12:00
We try to solve specific logical problems in Java using some form of loops. In this post we present an example on how to print even numbers using while loop in Java Read More
2019-09-05 16:00
File manipulation is a common programming theme that we need to do. As we store some data into a file, it is natural for us to be able to read and write into a file. The most common file fo… Read More
2019-09-02 16:18
The multiply assign operator does two operations in one statement. First is that it multiplies the value of a variable on the left side with the evaluated value of the expression on the rig… Read More
2019-09-02 16:09
XOR or the Binary Exclusive OR operation is a common bitwise operation in any language, including Java. Below are examples on how to use Binary Exclusive OR Assign Operator in the Java prog… Read More
2019-09-02 16:08
In Java, Compounded Assignment Operator combines an operation and assignment into one statement, making code concise. Below is an example on how to do it with Binary OR operation. Which is… Read More
2019-09-02 16:06
Binary Right Shift Operator is an efficient way of dividing a number by a power of 2 number, preserving the sign of the original number. Meaning this is a signed operation. We can combine… Read More
2019-09-02 16:05
The Binary left Shift Operator is an efficient way of multiplying a number by a power of two. And when we do that operation, we also typically want to assign back the resulting product to t… Read More
2019-09-02 16:04
If we want to divide a variable with some value, and then assign the modulus or remainder back to the original variable, then the Modulus Assign Operator is a better way of doing it. This o… Read More
2019-09-02 16:03
The divide assign operator is a short hand notation provided by Java so we could shorten our code where we want to divide a variable by some value and assign back the result to the variable… Read More
2019-09-01 16:01
It is very hard to write any program without using variables. And when we use variable, the first thing we want to do is to assign it some values. Variables are like storage of data, so it… Read More
2019-09-01 16:00
The most basic way we use a programming language is to develop programs that performs mathematical calculations. The foundation of the most basic of all mathematical operations are arithmet… Read More
2019-08-24 17:03
The fourth problem we wish to give is again an enhancement of the first problem in this series that also draws a triangle. This time, we wish to draw an inverted triangle as shown below for… Read More
2019-08-24 17:02
We continue our series in nested loop logic problems and we improve on the first problem we stated. We are now reversing the pattern of the triangle, and instead of showing this pattern for… Read More
2019-08-24 17:01
For the series of drawing triangles using nested loop, we present our second problem that enhances the first problem in this post. This also accepts a number and draws a triangle pattern ac… Read More
2019-08-24 17:00
For those who wish to improve their logical programming skills, we will be showing simple problems that can be solved using nested loops. Below is our first problem, where given a number wi… Read More
2019-07-28 16:00
We always love working with Strings in our own programs. Strings is one of the most common data structure in most programming language. One common thing we wish to do with String is to cle… Read More
2019-07-27 17:03
The switch statement is a beautiful alternative to multiple if else, when all we want to do is match a variable's value to one of many values, to determine what to do. The switch statement… Read More
2019-07-27 16:00
Most String manipulation problems requires us to come up with combination of information and summarize into one String. For example, imagine we wish to convert an integer value into words a… Read More
2019-07-25 17:05
When we are programming with String, or doing String manipulation in short, a typical problem we encounter is we wish to concatenate together some Strings using a specific delimiter. For ex… Read More
2019-07-25 16:00
List in Java is a powerful data structure because it can hold arbitrary number of Objects. Unlike Arrays, List in Java can be resized at any point in time. For example, if we have a Java L… Read More
2019-04-01 16:00
Java Enums is a new feature introduced in Java 5. Using Java Enum can help define a collection of constants in a more logical and meaningful way. Using Java Enum is a fluent way of definin… Read More
2019-03-16 16:00
In mathematics, factorial of a number means taking the product of all positive integers less than or equal to the given number. Or the product of multiplying all numbers from one to the giv… Read More
2019-03-15 16:04
The Fibonacci sequence is a very popular sequence in Math. The first two numbers in the sequence is 0 and 1. And all the succeeding numbers in the series is derived by adding the previous… Read More
2019-03-15 16:01
In programming, tokenizing a String is a simple way of achieving lexical analysis. It is a simple way of producing parts of a String that we can process one by one. We achieve this in Java… Read More
2019-03-15 16:00
Enum is a very convenient way of representing a group of information that is fairly static. For example, Sex, Marital Status, and such can be represented by Enum. Enum is great way to do th… Read More
2019-02-05 16:00
String manipulation is an important part of any general purpose programming language. For example, we may want to extract some data from a given String or text. In this case, performing Su… Read More
2018-12-26 16:00
Java hashCode() method has a close relationship with the equals() method as they complement and are used together. On a high level, the equals method should inspect the relevant data of two… Read More
2018-12-25 16:02
When we are dealing with a handful of data of the same type, we can use a different variable for each. But if we are working with arbitrarily more numbers of data of same type, array can be… Read More
2018-12-25 16:01
Although a very old and dated data structure, array is still a very popular data structure to work with a collection of objects. This is because manipulation of arrays is very simple to lea… Read More
2018-12-25 16:00
Byte Array is a convenient data structure that has many use cases. One scenario is when serializing some object to a file, and so we need to convert object to byte array when we write to fi… Read More
2018-12-24 16:50
Hash code in Java is very important specially with the introduction of the Java Collections API. Many classes in the Collections API uses hash code as a convention. So what exactly is a ha… Read More
2018-12-24 16:00
The trend in the software development industry is going in the direction of making things easier and simpler. This is why languages such as Groovy is getting popular as time pass by. And t… Read More
2018-12-19 16:00
Groovy is now getting popular with the help of the increasing user base of Gradle. Groovy language is exceptional in being a very concise and powerful language. Compared to Java, writing t… Read More
2018-10-31 17:02
String is one of the most fundamental data structure. It is versatile and useful for many cases. This is why Strings are used in many cases instead of using more restrictive data structure… Read More
2018-10-31 17:01
String is an all around data structure for saving information because it can handle arbitrary sequence of characters. Often times, it is also used to store numeric, date, or other type of i… Read More
2018-09-26 02:10
String is just a staple of most programming languages. It represents a sequence of characters into one data structure. It is a very convenient way to store many types of things in memory o… Read More
2018-09-25 16:00
Object is the root class of all classes in Java. Every class that we use or declare in Java has Object as a super class when traced to the top. All objects, including primitive wrappers, i… Read More
2018-05-25 02:10
Strings and Arrays are two of the most popular data type in Java and in other popular language. String are able to represent a series of characters that is viewed as a single entity. While… Read More
2018-05-24 16:00
Array is the most basic way to represent a group of data with unknown size. Collections has been popular in recent years but arrays will always have a good use case because of it's simplici… Read More
2018-05-05 16:01
Programmers usually want to use arrays because it can hold arbitrary number of items, depending on how we created the array object. Most of the things we wish to do with arrays, like search… Read More
2018-05-04 16:45
We usually use integers when we want to calculate whole numbers. But Integers in Java can only hold 32 bit values which could be insufficient for some tasks. When we need bigger range of v… Read More
2018-05-04 16:01
Int or Integer is one of the common data type that we will encounter in Java since most programming involves calculations, and integers are the most basic numbers we could manipulate. We sh… Read More
2018-05-01 16:01
Array is one of the favorite data structure in Java and in other languages. It is so simple to use and easy to manipulate. And so we wish to do some operations to it from time to time. Fo… Read More
2018-04-30 16:00
Developers loves to use arrays to store multiple values whenever possible because of it's simplicity and ease of use. It is not very flexible as the other classes in the collections API, bu… Read More
2017-03-15 16:00
We will show in this post on how to convert an ArrayList to a Array in Java. Although ArrayList are usually more flexible and powerful, sometimes we need to convert it to simple arrays. Mo… Read More
2016-11-02 16:00
It is a common scenario in programming when we wish to check if one String contains a specific substring. For example, we wish to test if the String "The quick brown fox" contains the subst… Read More
2016-06-13 02:15
Reading text files is one of the most common file manipulation task in Java. Here are some examples of how to read text files in Java using long method and also shortcuts in recent Java ver… Read More
2016-01-10 04:21
In most cases where precision is important, we work with numbers having decimal point rather than whole numbers. For example, computation of points in 3D space - float will be more ideal fo… Read More
2016-01-09 03:30
It is convenient to use doubles on calculations because of the flexibility on precision. But once we are done with complex computation, we would wish to extract the integral part of the res… Read More
2015-12-25 15:30
When we are dealing with small number of data, we can use a variable for each data we need to monitor. If we don't know how much data we need to process, or if the data is large, an array i… Read More
2015-12-25 15:15
Arrays are usually useful when working with arbitrarily large number of data having the same type. It is usually convenient if we can print the contents of an array. Below are some example… Read More
2015-12-25 13:30
Prime Number is a concept in math, specifically in number theory. A Prime Number is a whole number greater than 1 that has no positive divisors except 1 and itself. For example, the number… Read More
2015-12-25 10:30
An array is a type of variable that can hold multiple values of similar data type. This is very useful for storing values when we don't know how many of them is needed, or when the number o… Read More
2015-12-22 13:45
An Array in Java can hold arbitrary number of elements, depending on how the array object was created. To perform operations on array, it is fundamental to know it's length. For example, i… Read More
2015-11-18 06:00
An array is a common data structure in many languages. It is simple and easy to understand, hence it is commonly used in many situations. However, it is very common requirement to sort a a… Read More

Share the post

JavaDevNotes

×

Subscribe to Javadevnotes

Get updates delivered right to your inbox!

Thank you for your subscription

×