Java RandomAccessFile explanation with examples

RandomAccessFile is an important class in the Java IO package. Using this class, we can easily point to any position of a file, read any specific part of a file or write content to anywhere within a file. It behaves like a large array of bytes. The cursor, that is used to point to the current position of a file is called file pointer.

Read

Java program to do left rotation 'n' times to an array

In this tutorial, we will learn how to do the left rotation to an array. We will take the input from the user. The user will input both elements of the array and also the rotation number. Before starting the code, let me show you what is a left rotation and how it looks.

Read

Java example to filter files in a directory using FilenameFilter

Sometimes we need to filter out file list based on its extension. For example, filtering out all .mp3 files in a specific folder. To implement such scenarios in Java, we have one inbuilt interface known as FilenameFilter. In this tutorial, we will learn how to use FilenameFilter to filter out files in a specific directory.

Read

4 different Java programs to Convert a double to string without exponential

Learn to convert a double value to string in Java. We will use four different ways to do the conversion. Using String.valueOf(), String.format(), Double.toString(), by adding an empty string and by using DecimalFormat.

Read

Java Program to convert an ArrayList to an Array

ArrayList is more flexible than the array. But sometimes we need to convert an ArrayList to an array and this tutorial will show you different ways to convert ArrayList to an array in Java. We have different ways to do this conversion. Let's take a look :.

Read

How to split a string in Dart

Splitting a string is available in almost all programming languages. Splitting divides a string in different parts based on one expression or rule. In dart also, we have an inbuilt splitting method known as split(). We can define it as below :.

Read

Dart comparable example for comparing objects

Comparing two custom object can be done using Comparable interface. If you are familiar with Java, it works in a similar manner. In this tutorial, I will show you two examples of how to use it in Dart.Suppose, we have a list of students and we want to compare two students based on their marks. Our program will compare any two of the students and print out the result (which one got the highest mark).

Read

How to create a simple and capped collection in MongoDB

Collections are used to group MongoDB documents. If you are familier with RDBMS, you can think it like a table. Collections are created within a database. Again, documents are created within collection. These documents contains different different fields with different data.In this tutorial, we will show you how to create a collection with different ways to create different types of collection.

Read

MongoDB tutorial : How to drop a database in MongoDB

Drop a database means deleting a database. If you drop a database, it will remove everything inside it.In this tutorial, we will show you how to drop a database in MongoDB.

Read

How to create a database in MongoDB and insert data

Database is used in MongoDB to store all different types of collections and each collection stores documents. We will come to this later, but before that let's learn how to create a database and how to move between databases.

Read