What is Telematics? Telematics is a combination of two technologies which include telecommunications and informatics. Telecommunications includes phone lines and cables while computer systems are included in informatics. The telematics technology is used in commercial fleet vehicles. The data is transmitted during the vehicle movement with the help of wireless telematics devices and black box technologies. The data that is transmitted include − Usage of the vehicle Maintenance Servicing Fleet management can also be performed with the help of telematics. The technology can be used to get the knowledge of vehicles in the entire fleet related to their ... Read More
Sometimes while writing the content of an HTML file, there might be the need to preserve blank spaces and line breaks. You might have noticed when you try to write something in the paragraph tag or the tag that has a lot of white spaces or a line break, it is not visible when the HTML page is rendered in the web browser. This article will show how to preserve those spaces while rendering the HTML page. Render an HTML String Preserving Spaces and Line Breaks Using HTML pre Tag ... Read More
In this program, we will use a regular expression to check if a given string does not contain the substring "kk" using Java. The regular expression ^((?!kk).)*$ is designed to match strings that do not include the "kk" pattern anywhere in the string. The program will evaluate a sample string and print whether or not it contains "kk". Problem Statement Write a program in Java for checking whether a given string contains the substring "kk." If the string does not contain "kk" the program will return true otherwise it will return false. Input String s = "tutorials" Output true ... Read More
In this article, we will explore how to find the longest common prefix among a given set of strings using two different approaches in Java. We will first discuss an approach that compares all strings directly to find the longest prefix and then move to a word-by-word matching approach. Problem Statement We are given a set of strings and we have to find the common prefix among all of them. A prefix is a substring for a string that contains the zero index and could be of any length from 1 to a complete string. Input 1 string arr[] = ... Read More
In this program, we will connect to a MySQL database using JDBC, insert a new record into the dispatches table, and retrieve all records from the table. The setTime() method from Date class of java.util package that accepts a variable of long type, representing the number of milliseconds from the epoch time (January 1, 1970, 00:00:00.000 GMT) to the required time, and sets the specified time value to the current Date object. //Setting time date.setTime(time_value_in_long); The goal of the program is to demonstrate how to interact with a database using JDBC and handle Date and Time objects in Java. ... Read More
In this article, we will learn to implement binary search on char array using Java. The binary search on a char array can be implemented by using the Arrays.binarySearch() method of java.util package. This method returns the index of the required char element if it is available in the array, otherwise, it returns (-(insertion point) - 1) where the insertion point is the position at which the element would be inserted into the array. Problem Statement Write a program in Java to implement binary search on char array Input 'b', 's', 'l', 'e', 'm' Output The sorted array is: b ... Read More
In the given article, we will learn to write a program in Java to increase the row height in a JTable. The example creates a table with different languages and their difficulty levels and then modifies the row height using the setRowHeight() method. Steps to increase the row height in a JTable Following are the steps to increase the row height in a JTable − Import the necessary classes from javax.swing package. Initialize a DefaultTableModel and create a JTable with it. Add columns to represent languages and ... Read More
In this article, we will understand how to iterate through each character of the string using Java. The string is a datatype that contains one or more characters and is enclosed in double quotes (“ ”). Char is a datatype that contains an alphabet an integer or a special character. Problem Statement Write a program to Iterate through each character of the string. Below is a demonstration of the same − Input The string is defined as: Java Program Output The characters in the string are: J, a, v, a, , P, r, o, g, r, a, m, Different approaches ... Read More
In this article, we will learn how to sort an ArrayList in ascending order using Java. Sorting allows us to arrange elements in a specific order. We will use the Collections.sort() method, which simplifies sorting, whether you're dealing with integers or strings. The program will demonstrate sorting an ArrayList of numbers and names in ascending order. Problem Statement Write a Java program that sorts an ArrayList of elements in ascending order. We'll look at two examples—one with integer values and another with string values. Input 1 Points[50, 29, 35, 11, 78, 64, 89, 67] Output 1 Points (ascending)[11, 29, 35, ... Read More
In this article, we will understand how to find the area of a trapezium using Java. The trapezium is a type of quadrilateral that has at least one pair of sides parallel to each other. The parallel sides of a trapezium are called bases and the non-parallel sides of a trapezium are called legs. It is also called a trapezoid. The area of a trapezium is calculated using the formula − (height/2 * (side_1 + side_2). i.e. Area = ½ x (sum of the lengths of the parallel sides) x perpendicular distance between parallel sides Below is a demonstration of ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP