Lakshmi Srinivas

Lakshmi Srinivas

232 Articles Published

Articles by Lakshmi Srinivas

Page 14 of 24

Add the default styles for the dropdown menu container in Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 277 Views

Use the .dropdown-menu class in Bootstrap to add the default styles for the dropdown menu containerExample           Bootstrap Example                                          Mobile Phones          The following are the mobile phone brands available in India:                       Companies                                            Apple                Samsung                Oppo                Nokia                                

Read More

Add plain text next to a form label within a form with Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 601 Views

To add plain text to a form label within a form, use the .form-control-static in Bootstrap.You can try to run the following code to implement a .form-control-static class in BootstrapExample           Bootstrap Example                                                       Email:                            amit@demo.com                                

Read More

Set active state for Bootstrap Buttons

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 2K+ Views

To set the active state for Bootstrap Buttons, use the .active class.The button will appear pressed as in the following codeExample           Bootstrap Example                                 The following are some buttons:                Default Button                      Active Button          

Read More

Hide content depending on screen size with Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 737 Views

Use the .hidden-* class in Bootstrap to hide content depending on screen size with BootstrapExample           Bootstrap Example                                 This is visible.       This is hidden.       Hidden on small screen       Hidden on medium screen    

Read More

Image Thumbnail with Bootstrap

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 918 Views

To add a thumbnail to the image, use the .img-thumbnail Bootstrap class.You can try to run the following code to add a thumbnail to imagesExample           Bootstrap Images                                 Styling images with Bootstrap       Original Image             Thumbnail Image          

Read More

What is the difference between super and this, keywords in Java?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 785 Views

The this is a keyword in Java which is used as a reference to the object of the current class. Using it you can − Differentiate the instance variables from local variables if they have same names, within a constructor or a method. Call one type of constructor (parametrized constructor or default) from other in a class. It is known as explicit constructor invocation. Example class Superclass { int age; Superclass(int age) { this.age = age; } public void ...

Read More

How to return an array from a method in Java?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 6K+ Views

We can return an array in Java from a method in Java. Here we have a method createArray() from which we create an array dynamically by taking values from the user and return the created array.Exampleimport java.util.Arrays; import java.util.Scanner; public class ReturningAnArray {    public int[] createArray() {       Scanner sc = new Scanner(System.in);       System.out.println("Enter the size of the array that is to be created:: ");       int size = sc.nextInt();       int[] myArray = new int[size];       System.out.println("Enter the elements of the array ::");       for(int i=0; i

Read More

Java program to print ASCII value of a particular character

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 17-Dec-2024 1K+ Views

In this article, we will learn to print the ASCII value of a particular character in Java. ASCII (American Standard Code for Information Interchange) is a standard encoding system that assigns a unique numeric value to characters like letters, digits, and symbols. We’ll explain the concept of ASCII, demonstrate how to retrieve and display ASCII values in Java and provide practical examples to help you understand and apply this concept effectively. What Is ASCII? ASCII is a character encoding standard where each character (letters, digits, and symbols) is assigned a numeric value. For instance − ...

Read More

Java program to find the roots of a quadratic equation

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 21-Oct-2024 15K+ Views

In this article, we will learn to find the roots of a quadratic equation using Java. The roots of a quadratic equation are determined by the following formula: $$x = \frac{-b\pm\sqrt[]{b^2-4ac}}{2a}$$ Here we will take input values for the coefficients 𝑎, 𝑏, and 𝑐 of the quadratic equation 𝑎 𝑥 2 + 𝑏 𝑥 + ...

Read More

Java program to find the sum of elements of an array

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 14-Jun-2024 47K+ Views

To find the sum of elements of an array.create an empty variable. (sum)Initialize it with 0 in a loop.Traverse through each element (or get each element from the user) add each element to sum.Print sum.Exampleimport java.util.Arrays; import java.util.Scanner; public class SumOfElementsOfAnArray {    public static void main(String args[]){       System.out.println("Enter the required size of the array :: ");       Scanner s = new Scanner(System.in);       int size = s.nextInt();       int myArray[] = new int [size];       int sum = 0;       System.out.println("Enter the elements of the array one by one ");       for(int i=0; i

Read More
Showing 131–140 of 232 articles
« Prev 1 12 13 14 15 16 24 Next »
Advertisements