Articles on Trending Technologies

Technical articles with clear explanations and examples

Java program to multiply given floating point numbers

Shriansh Kumar
Shriansh Kumar
Updated on 16-Aug-2024 2K+ Views

Suppose two floating point numbers are given as operands and your task is to write a Java program to multiply the given numbers. To perform this operation, initialize two float values, multiply and store the result in another float type variable. Float is a datatype in Java which stores numbers with fractional part. Example Scenario: Input 1: num1 = 1.2 Input 2: num2 = 1.4 Output: product = 1.68 Using Multiplication Operator The multiplication operator is represented by asterisk sign (*). It is categorized under arithmetic operator in Java. It can be used to multiply float values ...

Read More

Java Program to get day of week as string

Shriansh Kumar
Shriansh Kumar
Updated on 16-Aug-2024 3K+ Views

Some applications that work on calendars require a day name to be displayed for features like scheduling tasks, events or reminders. For this purpose, Java provides various built-in classes and methods including LocalDate, Calendar and SimpleDateFormat. In this article, we will learn how to use these classes and methods in Java programs to find the day name of a week for a given date. Using LocalDate Class In this approach, we first find current date using LocalDate class and using its built-in method named getDayOfWeek(), we create a DayOfWeek Enum which can be converted to String to display day ...

Read More

Java program to join two given lists

Arjun Thakur
Arjun Thakur
Updated on 14-Aug-2024 3K+ Views

To join two given lists the addAll() method of the java.util.ArrayList class is used to insert all of the elements in the specified collection into this list. To add contents of a list to another − Problem Statement Write a program in Java to join two given lists − Input Contents of list1 ::[Apple, Orange, Banana] Contents of list2 ::[Grapes, Mango, Strawberry] Output Contents of list1 after adding list2 to it ::[Apple, Orange, Banana, Grapes, Mango, Strawberry] Steps to join two given lists Following are the steps to join two given lists − ...

Read More

Subarray with given sum in Java with different approaches

Areeba Rashid
Areeba Rashid
Updated on 14-Aug-2024 389 Views

Finding a subarray with a given sum is a common problem that often appears in coding interviews and competitive programming. This problem can be solved using various techniques, each with its own trade-offs regarding time complexity and space complexity. In this article, we'll explore multiple approaches to solving the problem of finding a subarray with a given sum in Java. Problem Statement Given an array of integers and a target sum, find a continuous subarray in the array that adds up to the given sum. The problem can be divided into two main variants: Subarray ...

Read More

Java program to remove duplicates from a given stack

Anh Tran Tuan
Anh Tran Tuan
Updated on 14-Aug-2024 630 Views

In this article, we’ll explore two methods to remove duplicate elements from a stack in Java. We’ll compare a straightforward approach with nested loops and a more efficient method using a HashSet. The goal is to demonstrate how to optimize duplicate removal and to evaluate the performance of each approach. Problem statement Write a Java program to remove the duplicate element from the stack. Input Stack data = initData(10L); Output Unique elements using Naive Approach: [1, 4, 3, 2, 8, 7, 5] Time spent for Naive Approach: 18200 nanoseconds Unique elements using Optimized Approach: [1, 4, 3, 2, ...

Read More

Wildcard Selectors (*, ^ and $) in CSS for classes

Shubham Vora
Shubham Vora
Updated on 14-Aug-2024 14K+ Views

CSS wildcard selectors allow us to select an HTML element containing the particular substring in the value of the particular attribute, such as classes, id or other attributes. It is useful when style is applied to multiple elements having a common pattern in their attributes. In this article, we will be learning about wildcard selectors in CSS and it's types which are mentioned below. Contains (*=) wildcard selector Starts with (^=) wildcard selector Ends with ($=) wildcard selector Contains (*=) wildcard selector CSS contains(*=) wildcard ...

Read More

Create the Indian Flag using HTML and CSS

Harshit Sachan
Harshit Sachan
Updated on 14-Aug-2024 14K+ Views

To create the Indian flag using HTML and CSS, we will need to have good understanding of CSS. Indian flag have three colors: saffron, white and green and Ashoka Chakra at the middle. In this article, we will be creating stepwise Indian flag. First making a pole then tricolor and then rotating Ashoka chakra all with the help of HTML and CSS only. Later we will be animating our flag with wave animation and flag movement. These are the steps which we will be following: .flag-container { ...

Read More

Grouping Selectors in CSS

AmitDiwan
AmitDiwan
Updated on 14-Aug-2024 21K+ Views

CSS grouping selector is used to select multiple elements and style them together. This reduces the code and extra effort to declare common styles for each element. To group selectors, each selector is separated by a space. In this article, we will be understanding how to apply grouping selectors in CSS. Applying Grouping Selectors in CSS We have applied grouping selector using element name and using id of the element. We have used div and article element as grouping selector to apply background-color, color and text-align properties to div and article tag making it center ...

Read More

Difference between Kimball and Inmon

Shirjeel Yunus
Shirjeel Yunus
Updated on 13-Aug-2024 540 Views

One of the important aspects of business development is the design of a Data Warehouse in which a schema is used to collect different data sources. The two popular architectures used to design a data warehouse are Kimball and Inmon. In this article, we will discuss the difference between Kimball and Inmon. What is Kimball? Ralph Kimball introduced the Kimball approach to design a data warehouse. This is an approach in which business processes and questions are recognized and the answer to these questions has to be given by the data warehouse. The information provided by the data warehouse is ...

Read More

Difference between Apache Tomcat Server and Apache Web Server

Shirjeel Yunus
Shirjeel Yunus
Updated on 13-Aug-2024 519 Views

Apache Software Foundation is the company that owns the Apache Tomcat Server and Apache Web Server. Apache Tomcat Server works as a container for Java Servlet and Apache Web Server is an HTTP server. Many users get confused between both of these servers. In this article, we will discuss the difference between Apache Tomcat Server and Apache Web Server. What is Apache Tomcat Server? Apache Tomcat is a server which works as a container for Java Servlets. Apache Tomcat Server was developed in 1998 and now it has become one of the best JavaScript web hosting solutions. It is also ...

Read More
Showing 13841–13850 of 61,248 articles
Advertisements