Create Navigation Bar with Left-Aligned and Right-Aligned Links using CSS

AmitDiwan
Updated on 05-Sep-2024 17:13:43

12K+ Views

To create a navigation bar with left-aligned and right-aligned links with CSS, user should have a basic understanding of CSS flexbox. First, we will create the structure of navigation bar having five links using HTML, then we will use CSS to design the navigation bar and align the links on the left and right sides of the navigation bar, and apply flexbox properties to ensure proper positioning of links. We are having a navigation menu containing five links, our task is to create a navigation bar with left-aligned and right-aligned links with CSS. In this article, we will be implementing ... Read More

Nesting and Grouping in CSS

Riya Kumari
Updated on 05-Sep-2024 12:08:49

2K+ Views

Nesting and Grouping in CSS helps developers to write short and precise codes that are easy to run. Lengthy codes are always disadvantageous for the developers as it becomes difficult to debug the codes and increases the loading time for the web pages, decreasing the readability of the websites. In this article, we will be understanding about nesting and grouping, their advantages , their differences and how they help in reducing the code size, increasing the readability and making web site maintainable. Nesting in CSS Grouping in CSS Nesting ... Read More

Create a HashMap and Add Key-Value Pairs in Java

karthikeya Boyini
Updated on 05-Sep-2024 11:25:07

1K+ Views

In this article, we will write a Java program to create a HashMap and add key-value pairs. We will be using the HashMap class we can import HashMap class form java.util package. A HashMap is a collection that stores data in the form of key-value pairs, allowing quick retrieval of values based on their keys. We'll also see how to display the elements stored in the HashMap using an iterator in our given program. Problem Statement Write a program in Java to create a HashMap and add key-value pairs − Output Belt: 600Wallet: 700Bag: 1100 Steps to create a HashMap and add ... Read More

Get Random Letters in Java

karthikeya Boyini
Updated on 05-Sep-2024 11:24:47

2K+ Views

In this article, we will learn to write a program in Java to get the random letters in both lowercase and uppercase. We will be using Random class from java.util package.The program will first create random lowercase letters by selecting them from the alphabet, and then it will generate random uppercase letters in a similar way.  Problem Statement Write a program in Java to get the random letters both uppercase and lower case. Below is the demostration − Output Lowercase random letters...dlhjsUppercase random letters...BKIZN Step to get random letters Following are the steps to get the random letter using Java ... Read More

Check Occurrence of Each Character in a String in Java

Chandu yadav
Updated on 05-Sep-2024 11:23:51

25K+ Views

To find the occurrence of each character in a string we can use the Map utility of Java. In Map a key cannot be duplicated so make each character of the string a key of Map and provide the initial value corresponding to each key as 1 if this character is not inserted in Map before. Now when a character repeats during insertion as a key in Map increases its value by one. Continue this for each character until all characters of the string get inserted. Problem Statement Write a program in Java to check the occurrence of each character in ... Read More

Find Sum of Natural Numbers Using While Loop in Java

Shiva Keerthi
Updated on 05-Sep-2024 11:23:05

673 Views

The sum of natural numbers can be calculated using different Iterative Statements in Programming Languages. Iterative Statements are statements that execute a particular set of code lines until the condition in the loop statement fails. In this article, we will discuss how to calculate the sum of natural numbers using a while-loop which is an iterative statement in Java. Sum of Natural Numbers The sum of natural numbers generally indicates the total sum of elements from 1 to n. Mathematically it can be represented as follows Sum of n Natural Numbers = 1+2+3+.........+(n-2) + (n-1) + n ... Read More

Get Milliseconds Between Dates in Java

karthikeya Boyini
Updated on 05-Sep-2024 11:22:45

2K+ Views

In this article, we will learn to get milliseconds between dates in Java. We will be using the LocalDateTime class from java.time package and ChronoUnit.MILLIS of java.time.temporal package. ChronoUnit is an enum that is part of Java date and time API which represents a unit of time that is days, hours, minutes etc. Here, the MILLIS is a unit that represents the concept of a millisecond. Problem Statement Write a program in Jave to get milliseconds between dates. Below is the representation − Input Date One = 2024-09-04T05:40:19.817038951Date Two = 2019-04-10T11:20 Output Milliseconds between two dates = -170533219817 Steps to get milliseconds between dates ... Read More

Find Sum of Even Factors of a Number in Java

AmitDiwan
Updated on 05-Sep-2024 11:22:18

949 Views

In this article we’ll find the sum of even factors of a given number using Java. We’ll start by checking if the number is even, then identify all of its factors, sum up those that are even, and finally display the result. Problem Statement Write a Java program to find the sum of even factors of a number. Below is the demostration of the same − Input num=16 Ouput The sum of even factors of the number is 30 Steps to find sum of even factors of a number Following are the steps to find sum of even factors of a number ... Read More

Subtract 1 Year from the Calendar in Java

Samual Sam
Updated on 05-Sep-2024 11:21:31

2K+ Views

In this article, we will subtract one year from the calendar in Java. We will be using Calender class from the java.util package. The program captures the current date, subtracts one year from it, and then displays the updated date. Problem Statement Write a Java program to subtract one year from the calendar. Below is a demonstration of the same − Input Current Date = Fri Nov 23 06:39:40 UTC 2018 Output Updated Date = Thu Nov 23 06:39:40 UTC 2017 Steps to subtract 1 year from the calendar Following are the steps to subtract 1 year from the calendar − ... Read More

Difference Between A* and AO* Algorithm

Abhijat Sarari
Updated on 04-Sep-2024 18:38:29

7K+ Views

In the fields of artificial intelligence and computer science search algorithms are essential for resolving challenging issues. Envision yourself searching for the way out of an enormous maze. You might aimlessly attempt every route in the hopes of failing. But wouldn't it be preferable to have a knowledgeable guide who is familiar with the maze ? In the digital realm, search algorithms are precisely like that! They assist computers much like you in a maze of options in determining the optimal course. The algorithms A* and AO* are two examples. In this blog article we'll go over their definitions, mechanisms, ... Read More

Advertisements