Java Articles

Page 116 of 450

Successor Graphs

Someswar Pal
Someswar Pal
Updated on 28-Jul-2023 1K+ Views

Introduction A Successor Graph is a model of a directed graph in which each node stores a list of the nodes that come after it. Successor graphs are better than an adjacency matrix or list because they speed up access to outgoing edges. This makes them perfect for algorithms that need quick access to successor vertices. This choice of design works well for graphs with a lot of points but not many edges Representation of Successor Graphs using Adjacency Matrix Successor graphs store only the direct successors of each vertex, reducing memory usage and speeding up edge insertion and deletion ...

Read More

Difference Between FileInputStream and FileReader in Java

Way2Class
Way2Class
Updated on 28-Jul-2023 1K+ Views

When working with file input in Java, engineers regularly come over two commonly utilized classes: FileInputStream and FileReader. Both classes serve the purpose of reading information from records, but they differ in their approaches and utilization scenarios. In this article, we'll look at the contrasts between FileInputStream and FileReader, their dialect structure, and their particular code cases. Syntax FileInputStream FileInputStream inputStream = new FileInputStream("file.txt"); FileReader FileReader fileReader = new FileReader("file.txt"); Explanation of Syntax FileInputStream The FileInputStream class is utilized to read binary information from records. It takes a record way as a parameter and makes a stream for ...

Read More

Difference Between EnumSet and TreeSet in Java

Way2Class
Way2Class
Updated on 28-Jul-2023 274 Views

In Java, collections provide a wide range of options for storing and manipulating data. Two popular collection classes, EnumSet and TreeSet, offer distinct approaches for managing sets of elements. While they both serve the purpose of storing unique elements, they have fundamental differences in their implementation and usage. This article aims to delve into these dissimilarities, providing a clear understanding of EnumSet and TreeSet in Java. Syntax Before we investigate their contrasts, let's look at the fundamental language structure for making EnumSet and TreeSet occurrences − EnumSet EnumSet enumSet = EnumSet.noneOf(EnumType.class); TreeSet TreeSet treeSet = new TreeSet(); ...

Read More

Print matrix elements using DFS traversal

Someswar Pal
Someswar Pal
Updated on 28-Jul-2023 1K+ Views

Introduction Depth-First Search (DFS) is a graph traversal method that looks at vertices and edges by starting at a certain node and going as far as possible down each branch before going back.It looks at the "depth" of the graph, starting with the node that is the deepest and then going back to look at other lines. Recursion or a stack can be used to make DFS work. It can be used to find paths, find cycles in graphs and vectors, and do exhaustive searches. Understanding the Matrix Structure In data analysis, a matrix is a two-dimensional array. Matrix data ...

Read More

Difference between Early and Late Binding in Java

Way2Class
Way2Class
Updated on 28-Jul-2023 3K+ Views

In object-oriented programming, official refers to the method of interfacing a strategy call to its execution. Java, an object-oriented programming dialect, supports early official and late authoritative which are too known as inactive authoritative and energetic authoritative, separately. Both forms of binding have advantages and applications. We will look at the syntax, explanation, and distinctions between early and late binding in Java in this post. Syntax The syntax for early binding in Java is as follows. = new (); The syntax for late binding in Java is as follows. = new (); Explanation of ...

Read More

Maven Project with Junit – Checking for a Bank Account Number

Way2Class
Way2Class
Updated on 28-Jul-2023 241 Views

All the applications whether small or large are required to undergo a set of processes building, generating, compiling and running of the source code. These set of processes are manually performed by the programmers. However, with the launch of the Apache’s Maven Project, all these sets of processes can be automated and the manual work can be avoided. Therefore, the maven project is an open source tool that is used to build and deploy several projects at once for providing better project management. In this article, we will be discussing the Maven Project for checking a bank account number whether ...

Read More

What is MetaSpace in Java?

Way2Class
Way2Class
Updated on 28-Jul-2023 2K+ Views

"MetaSpace" is not a phrase that is generally used or recognised as part of the Java Programming language’s standard library or syntax. As a result, "MetaSpace" is likely to relate to anything specific to a particular Java programme or project, rather than a general Java idea. It is impossible to offer a detailed description or explanation of "MetaSpace" in Java without further context or infformation about the individual application or project. However, it’s possible that "MetaSpace" refers to thhe physical world rather than the digital or virtual world. It may be used in this context to distinguish between online or ...

Read More

Mapping CSV to JavaBeans using OpenCSV

Way2Class
Way2Class
Updated on 28-Jul-2023 2K+ Views

CSV files are basically plain text files that stores data in columns separated a comma. OpenCSV is the library that parses these CSV files which are quite difficult to handle otherwise. It is a quite easy to use library that supports several features like reading and writing of CSV files with headers. We will be discussing the mapping of CSV files to JavaBeans via OpenCSV in this article. Additionally. OpenCSV is a tool that aids in this process. Mapping the CSV to JavaBeans The OpenCSV library provides certain classes and mapping strategies to map the CSV files into Java Beans. ...

Read More

LongFunction interface in Java

Way2Class
Way2Class
Updated on 28-Jul-2023 230 Views

A LongFunction in Java is a functional interface which takes one argument of type long and returns a result of some other type. Functional interface is an interface that have only one abstract method. To use this interface first you have to import java.util.function package.  The functional method of this interface is ‘apply()’ which takes long value as an argument and returns function result denoted by R. Syntax R apply(long value); Algorithm In order to effectively implement this functional interface into your work, there are three defining steps one must abide by beforehand. First off, establishing an ...

Read More

Create a Simple Login Web Application with Encrypted Password in Java

Way2Class
Way2Class
Updated on 28-Jul-2023 993 Views

Building a web application with encrypted password can be a challenging task in Java. Let’s simplify this process and look into how to create a simple login web application with encrypted password using JSP and Servlets. Powered by advanced technological developments, our state-of-the-art login system grants access privileges exclusively to registered users via unique log-in credentials that are carefully verified before granting restricted entry into secure areas on our website infrastructure. Integrating with JDBC (Java DataBase Connectivity), we're ensuring industry-standard secure storage of sensitive customer details within our project's backend that strictly complies with recognised server security best-practices that stress ...

Read More
Showing 1151–1160 of 4,496 articles
« Prev 1 114 115 116 117 118 450 Next »
Advertisements