Found 9326 Articles for Object Oriented Programming

Java program to find array sum using bitwise OR after splitting given array in two halves after K circular shifts

Rudradev Das
Updated on 06-Apr-2023 18:00:21

142 Views

Array is a set of a single non primitive similar data types (values or variables) that stores the elements in a memory with a fixed number of values. After creating an array with certain elements, the length of this data set became fixed. Here non primitive means, these data types can be used to call a method to perform a particular operation which can be null in character. Here the bitwise sum means, sum of certain numbers with an exactly 2 bits set. Bitwise OR denotes that each integer is present in a subarray. It is an adjacent non-void element ... Read More

Java Program to count inversions of size three in a given array

Rudradev Das
Updated on 13-Apr-2023 12:02:43

155 Views

Inversion count is a step counting method by which we can calculate the number of sorting steps taken by a particular array. It is also capable to count the operation time span for an array. But, if we want to sort an array in a reverse manner, the count will be maximum number present in that array. Array: { 5, 4, 3, 2, 1} // for the reverse manner Pairs: {5, 4}, {5, 3} , {3, 2}, {3, 1}, {2, 1}, {4, 3}, {4, 2}, {4, 1}, }, {5, 2}, {5, 1} Output: 10 Array: {1, 2, 3, 4, ... Read More

Java Program to Extract a Single Quote Enclosed String from a Larger String using Regex

Pranay Arora
Updated on 06-Apr-2023 10:28:00

797 Views

Regex or Regular Expression is language used for pattern-matching and string manipulation. It consists of a sequence of characters which define a search pattern and can be used for performing actions like search, replace and even validate on text input. A regular expression consists of series of characters and symbols that amount to form a search pattern. In this article, we are going to see how to write a java program to extract a single quote enclosed string from a larger string using Regex. Java provides support for regex from the java.util.regex package. The pattern class represents a compiled regular ... Read More

Java Program to Display Name of the Weekdays in Calendar Year

Pranay Arora
Updated on 06-Apr-2023 14:17:24

456 Views

A week in a calendar year consists of 5 weekdays: Monday, Tuesday, Wednesday, Thursday and Friday; the two remaining days (Saturday and Sunday) make up the weekend. If you're working with dates and calendars as an application developer, manually looking up names for weekdays in a year can be tedious. In this article we will take a deeper dive into various approaches using built-in classes and APIs with detailed code examples provided for both beginners and experienced Java developers alike - giving valuable techniques for simplifying a calendar-related task i.e. to Display Name of the Weekdays in Calendar Year using ... Read More

Java Program to Display Name of Months of Calendar Year in Short Format

Pranay Arora
Updated on 06-Apr-2023 14:17:02

468 Views

A year has 12 months which are named January, February, March, April, May, June, July, August, September, October, November, December. These are the complete names of the months and there are multiple ways to represent them like short format, complete format, MM or 2 integers format. In this article, we are going to see how to display names of months of calendar year in short format with the help of Java. There are numerous ways to do so and are as follows − Using a String Array Using the java.time.Month Enum Using the java.text.DateFormatSymbols Class Using a Map Using the ... Read More

Java Program to Demonstrate How User Authentication is Done

Pranay Arora
Updated on 06-Apr-2023 10:18:43

2K+ Views

Authentication refers to the process of verifying the identity of an individual to make sure the user is exactly who they are claiming to be before giving access to a system. It is very important to authenticate a user to ensure the security as well as integrity of the system. Over the course of time, authentication has developed into much more advanced and secure methods. The methods of authentication now range from credentials like user id, password and OTP to finger print scan, face ID scan and much more. Authentication ensures that no sensitive resources are being shared with unauthorised ... Read More

Why Java will Remain Programming Language for 2023

Mr. Satyabrata
Updated on 06-Apr-2023 10:17:29

651 Views

Java is a high-level, object-oriented programming language that was first released in 1995. It was designed to be portable across platforms and devices, allowing developers to write code once and run it anywhere. Java is known for its simplicity, reliability, and security features, making it a popular choice for developing enterprise applications, mobile apps, games, and more. It has a large and active community of developers, resulting in a vast array of libraries and tools that make Java development even more efficient and effective. Java, the versatile programming language, celebrated its 25th anniversary in 2022. Despite its relative youth, ... Read More

Which Language Can Replace Java?

Mr. Satyabrata
Updated on 06-Apr-2023 10:15:04

624 Views

Java is a high-level object-oriented programming language that offers a class-based development approach, enabling the creation of software solutions with minimal dependencies. It is a versatile language that provides several benefits, including simplicity, platform orientation, security, and cost-effectiveness in terms of hardware resources. Additionally, Java is known for its stability and reliability. However, there are some disadvantages of using Java, such as high memory consumption, unattractive graphical user interfaces, and complex coding requirements. Pros and Cons of Java Pros of Java Memory Safety − Java eliminates the risk of null pointer exceptions, dangling pointers, and memory leaks, which are ... Read More

What are the Concepts Every Java Programmer Must Know?

Mr. Satyabrata
Updated on 06-Apr-2023 10:03:09

1K+ Views

Java is one of the most popular programming languages in the world, and it's extensively used for erecting enterprise- grade operations. As a Java programmer, it's essential to have a strong understanding of the language's core generalities and features. In this composition, we will bandy the abecedarian generalities that every Java programmer must know to make robust and scalable operations. Java Basics Java is an explosively compartmented language, which means that all variables must have a data type. Some of the generally used data types in Java include integers, floats, doubles, Booleans, and strings. In addition, Java has a ... Read More

What are the Best Resources for Programmers to Learn Java at an Advanced Level?

Mr. Satyabrata
Updated on 06-Apr-2023 10:02:33

424 Views

Java is a popular programming language used for developing web and mobile applications, games, and enterprise software. Advanced Java programming skills are highly sought after in the industry and can open up many job opportunities. However, learning Java at an advanced level requires dedication, effort, and access to the right resources. In this article, we will explore the best resources for programmers to learn Java at an advanced level and the benefits and drawbacks of doing so. Paths to Learn Java at an Advanced Level There are several paths that programmers can take to learn Java at an advanced level. ... Read More

Advertisements