Found 9321 Articles for Object Oriented Programming

New Features of Java 12

Deepti S
Updated on 15-May-2023 17:32:26

206 Views

Introduction to New Features of Java 12 On March 19, 2019, Java 12 was made available. Several new and enhanced features included in Java 12's release make it a worthwhile upgrade over Java 11 in almost every way. Switch Expressions, Default CDS Archives, Shenandoah, and Microbenchmark Suite are a few of the Java 12 features that deserve special mention. To increase Java's productivity, usability, and versatility for coders, these features have been added. We'll talk in-depth about these new capabilities in this article. Switch Expressions (JEP 325) Something interesting to point out is that Java 12 has brought about a ... Read More

Need of Concurrent Collections in Java

Deepti S
Updated on 15-May-2023 17:30:39

2K+ Views

Concurrent Collections in Java Java is a well-known computer language that supports concurrency and multithreading. Developers can use the synchronization keyword to guarantee correct synchronization between threads. Additionally, a variety of collections that can be used to hold and manipulate data are offered by Java's collection framework. The synchronized keyword can be used by coders to make these collections thread-safe. The efficient and secure execution of programs involving numerous threads operating concurrently depends on this capability. What Is the Need of Concurrent Collections in Java? ArrayList, LinkedList, HashSet, HashMap, and LinkedHashMap are just a few of the classes in Java's ... Read More

Taking a Snapshot from System Camera using OpenCV in Java

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

260 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

37K+ 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

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

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

131 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

258 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

203 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

360 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

135 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 16-May-2023 11:55:21

419 Views

The Internet Protocol suite contains all sort of protocols that enables communication between devices over the Internet. 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 connectionless 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. Java Networking ... Read More

Advertisements