Found 7442 Articles for Java

Taking a Snapshot from System Camera using OpenCV in Java

Siva Sai
Updated on 15-May-2023 15:53:30

485 Views

Introduction OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. It contains more than 2500 optimized algorithms, which are extensively used in real-time applications. Java provides bindings to OpenCV via the JavaCV library, allowing Java developers to leverage OpenCV's capabilities in their applications. One such application is capturing images from a webcam. Prerequisites To follow along, you need to have the following − OpenCV installed on your system. JavaCV, a wrapper for OpenCV in Java. Capturing a Snapshot using OpenCV To capture a snapshot, we need to create an ... Read More

System.out.println in Java

Siva Sai
Updated on 15-May-2023 15:47:08

54K+ Views

Introduction System.out.println is a method in Java that prints a message to the standard output (typically the console) and appends a newline character. It's widely used to display messages, data, and the results of operations during the execution of a program. This method is essential for understanding the flow of your code and debugging potential issues. Breaking Down System.out.println System.out.println may seem like a simple method, but it's worth understanding its components to get a better grasp of how it works. System − A built-in class in the java.lang package. It cannot be instantiated and provides access to standard input, output, ... Read More

Symmetric Encryption Cryptography in Java

Siva Sai
Updated on 15-May-2023 15:45:35

3K+ Views

Introduction Symmetric encryption, also known as secret-key encryption, is a type of encryption where the same key is used for encryption and decryption. This encryption method is fast and efficient, making it suitable for encrypting large amounts of data. The most commonly used symmetric encryption algorithm is the Advanced Encryption Standard (AES). Java provides strong support for symmetric encryption with the javax.crypto package, which includes classes such as SecretKey, Cipher, and KeyGenerator. Symmetric Encryption in Java Java's Cipher class in the javax.crypto package provides the functionality of a cryptographic cipher for encryption and decryption. It forms the core of the ... Read More

Swapping items of a list in Java _ Collections.swap() with Example

Siva Sai
Updated on 15-May-2023 15:41:37

318 Views

This article will provide an in-depth explanation of how to swap items in a list using the Collections.swap() method in Java. This topic is crucial for anyone looking to strengthen their data manipulation skills in Java, especially in dealing with list data structures. Java provides an extensive suite of tools for manipulating collections, including lists. One of these tools is the Collections.swap() method, which allows developers to easily swap the positions of two elements in a list. This method can be extremely handy when you need to rearrange elements in a list for various purposes, such as sorting, shuffling, or ... Read More

Swap Corner Words and Reverse Middle Characters

Siva Sai
Updated on 15-May-2023 15:38:37

450 Views

In this article, we'll delve into a fascinating string manipulation problem that involves swapping corner words of a string and reversing the middle characters. This kind of problem is quite common in coding interviews, and it's a great way to enhance your understanding of string manipulation in Java. Java provides a rich set of tools for string manipulation. From basic operations such as concatenation and comparison to more complex tasks such as string reversing and swapping, Java's String API can handle it all. One intriguing problem is to swap the corner words of a string and reverse the middle characters. ... Read More

Sum of Array Divisible by Size with Even and Odd Numbers at Odd and Even Index in Java

Siva Sai
Updated on 15-May-2023 15:11:05

304 Views

Understanding how arrays work is fundamental for any developer, and Java is no exception. Arrays in Java are objects that store multiple variables of the same type. However, arrays can often be used in more complex ways. One such instance is when you need to figure out if the sum of an array, considering only even numbers at odd indices and odd numbers at even indices, is divisible by the size of the array. In this article, we will guide you step-by-step on how to solve this problem. Problem Statement Given an array of integers, write a function in Java ... Read More

Size of file on the Internet using Java

Shriansh Kumar
Updated on 15-May-2023 17:35:08

624 Views

Determining the size of a file on the Internet seems a little tricky, but it is a quite simple and easy task. Java provides some built-in features that can be used for the given task. In this article, we will discuss how to make a connection to the Internet and fetch the size of a given file. How to establish a Connection on Internet using Java URL The modern Internet is all about World Wide Web. Tim Berners-Lee invented a way to locate all the resources on Web and he named it Uniform Resource Locator. It provides the feature ... Read More

Some important terms in Spring Security

Shriansh Kumar
Updated on 15-May-2023 17:29:39

298 Views

Spring is the most famous Java Web Framework available nowadays. It serves to build web applications through Java programming language. To work with this framework one needs to have a strong background and understanding of Java. It is essential to protect our valuable data from unethical practices. In this article, we will walk through some important terms in Spring Security that helps us in protecting users’ data. We won’t go into a deep analysis of any terminology. Terms related to Spring Security The Spring Security is an open source security framework and serves as a comprehensive security solution for your ... Read More

Simple Calculator via UDP in Java

Shriansh Kumar
Updated on 01-Sep-2025 12:16:07

695 Views

To enable communication between devices over the Internet, we use Internet Protocol suite. The UDP is one of the protocols of this suite and its full form is User Datagram Protocol. Unlike TCP, it is not reliable and also it is a connection less protocol. It does not establish any kind of connection to other devices before sending the data. In this article, we will develop a simple client-server side calculator using UDP in Java. The client will request the operation and the server will send the result to client device after calculating it. But first, let's briefly understand a ... Read More

Simple Calculator using TCP in Java

Shriansh Kumar
Updated on 01-Sep-2025 12:15:42

1K+ Views

The Internet Protocol suite contains all sort of protocols that enables communication between devices over the Internet. TCP is a connection-oriented protocol, which means it maintains the established connection between two devices till the end of a communication. This is the reason it is used while web surfing, sending emails and transferring files. In this article, we will develop a simple client-server side calculator using TCP in Java. The client will request the operation and the server will send the result to client device after calculating it. Java Networking Let's briefly understand a few basic concepts about Java networking that ... Read More

Advertisements