Align Flex Item from Start on Different Screens in Bootstrap 4

Ricky Barnes
Updated on 16-Jun-2020 10:53:26

154 Views

Use the .align-self-*-start class in Bootstrap 4 to align a flex item from the start on different screens.To align a flex item on different screens −Small Screen   Item 1   Item 2   Item 3   Item 4 Large Screen   Item 1   Item 2   Item 3   Item 4 Let us see the complete example to align a flex item from the start on different screens −ExampleLive Demo       Bootstrap Example                         Align Specific Flex Item from the start       Item 1     Item 2     Item 3     Item 4     Small Screen Size         Item 1     Item 2     Item 3     Item 4     Medium Screen Size       Item 1     Item 2     Item 3     Item 4     Large Screen Size       Item 1     Item 2     Item 3     Item 4  

Dark Grey Outlined Bootstrap 4 Button

Ricky Barnes
Updated on 16-Jun-2020 10:51:18

339 Views

To set dark grey outlined border to a button, use the btn-outline-dark class.Include the brn-outline-dark class as if you add any other class to an element. Here, we have the button element since we want a dark grey outline for our button:   Dark gray outline Let us see an eample to implement the btn-outline-dark class in Bootstrap −ExampleLive Demo       Bootstrap Example                             Bootstrap 4     Learning  btn-outline-dark class usage:     Dark gray outline  

Bridges in a Graph

Samual Sam
Updated on 16-Jun-2020 10:48:32

2K+ Views

An edge in an undirected graph is said to be a bridge, if and only if by removing it, disconnects the graph, or make different components of the graph. In a practical approach, if some bridges are present in a network when the connection of bridges is broken, it can break the whole network.Input and OutputInput: The adjacency matrix of the graph. 0 1 1 1 0 1 0 1 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 Output: Bridges in given graph: Bridge 3--4 Bridge 0--3AlgorithmbridgeFind(start, visited, disc, low, ... Read More

Bootstrap 4 Button btn-outline-primary Class

Ricky Barnes
Updated on 16-Jun-2020 10:44:09

369 Views

The btn-outline-primary class is used in Bootstrap 4 to set blue outlined button.Add blue outline to the button using the btn-outline-primary class as shown in the following code snippet −   Result You can try to run the following code to implement the btn-outline-primary class −ExampleLive Demo       Bootstrap Example                             Result     Click below to get the result:     Result  

Bootstrap 4 Card Grid Container

Amit Diwan
Updated on 16-Jun-2020 10:42:26

574 Views

Create a grid of cards with Bootstrap 4, using the card-columns class.Set the grid inside the class −   Include the card body inside the card container as in the following code snippet. I have added the card body under the card-class. The card-class is added inside the card-columns class −            Accessories       Let us see an example to create a grid of cards in Bootstrap −ExampleLive Demo       Bootstrap Example                             Products                             Accessories                                       Furnitures                    

Align Element with Top of Tallest Element in Bootstrap 4

Amit Diwan
Updated on 16-Jun-2020 10:40:24

129 Views

Use align-top class to align an element with the top of the tallest element on the line.Align the element like this −   Top Alignment Let us see an example to implement the align-top class in Bootstrap 4 −ExampleLive Demo       Bootstrap Example                             Example     This is demo text     Demo Baseline     Top Alignment     Middle Alignment     Bottom Alignment  

Perform Binary Search on an Array in Java

V Jyothi
Updated on 16-Jun-2020 10:17:11

229 Views

The Arrays class of java package provides you a method named binarySearch() using this method you can perform a binary search on an array in Java.ExampleLive Demoimport java.util.Arrays; public class ArrayDemo {    public static void main(String[] args) {       int intArr[] = {30,20,5,12,55};       Arrays.sort(intArr);       System.out.println("The sorted int array is:");       for (int number : intArr) {          System.out.println("Number = " + number);       }       int searchVal = 12;       int retVal = Arrays.binarySearch(intArr,searchVal);       System.out.println("The index of element 12 is : " + retVal);    } }OutputThe sorted int array is: Number = 5 Number = 12 Number = 20 Number = 30 Number = 55 The index of element 12 is: 1

Convert Array List of String to Array List of Integers using Lambda Expression in Java

Srinivas Gorla
Updated on 16-Jun-2020 10:12:36

878 Views

You can convert an array list of strings to an array list of integers as:ExampleLive Demoimport java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class LamdaExpressions {    public static void main(String args[]) {       ArrayList list = new ArrayList();       list.add("123");       list.add("223");       list.add("323");       list.add("334");       List listInteger =          list.stream().map(s -> Integer.parseInt(s)).collect(Collectors.toList());       System.out.println(listInteger);    } }Output[123, 223, 323, 334]

Put Java Arrays Inside an Array

Abhinanda Shri
Updated on 16-Jun-2020 10:11:04

2K+ Views

ExampleLive Demoimport java.util.Arrays; public class ArrayWithinAnArray{    public static void main(String args[]) {       int[] myArray1 = {23, 56, 78, 91};       int[] myArray2 = {123, 156, 178, 191};       int[] myArray3 = {223, 256, 278, 291};       int[] myArray4 = {323, 356, 378, 391};       int [][] arrayOfArrays = {myArray1, myArray2, myArray3, myArray4};       System.out.println(Arrays.deepToString(arrayOfArrays));    } }Output[[23, 56, 78, 91], [123, 156, 178, 191], [223, 256, 278, 291], [323, 356, 378, 391]]

Process Arrays in Java

Sharon Christine
Updated on 16-Jun-2020 10:10:14

2K+ Views

To process array elements, we often use either for loop or for each loop because all of the elements in an array are of the same type and the size of the array is known. Suppose we have an array of 5 elements we can print all the elements of this array as:ExampleLive Demopublic class ProcessingArrays {    public static void main(String args[]) {       int myArray[] = {22, 23, 25, 27, 30};       for(int i = 0; i

Advertisements