Samual Sam

Samual Sam

1,507 Articles Published

Articles by Samual Sam

Page 86 of 151

Date Formatting Using printf

Samual Sam
Samual Sam
Updated on 11-Mar-2026 8K+ Views

Date and time formatting can be done very easily using the printf method. You use a two-letter format, starting with t and ending in one of the letters of the table as shown in the following code.Exampleimport java.util.Date; public class DateDemo {    public static void main(String args[]) {       // Instantiate a Date object       Date date = new Date();       // display time and date       String str = String.format("Current Date/Time : %tc", date );       System.out.printf(str);    } }This will produce the following result ...

Read More

Move columns to the right with Bootstrap

Samual Sam
Samual Sam
Updated on 11-Mar-2026 4K+ Views

To move columns to the right, use the .col-*-offset-* class in Bootstrap.You can try to run the following code to implement itExample           Bootstrap Example                                                                   This is div1.             This is div2.                    

Read More

Bootstrap Form Radio Button

Samual Sam
Samual Sam
Updated on 11-Mar-2026 1K+ Views

Use radio class if you want to limit the user to just one selection i.e. adding radio buttons. Use.radio-inline class to a series of radios for controls appear on the same line.You can try to run the following code to implement Bootstrap Forms radio buttonExample           Bootstrap Forms                                       Favourite TV Series                             Suits                                                            House of Cards                    

Read More

Bootstrap block level help text

Samual Sam
Samual Sam
Updated on 11-Mar-2026 1K+ Views

Bootstrap form controls can have a block level help text that flows with the inputs. To add a full width block of content, use the .help-block after the .The following example demonstrates thisExample           Bootstrap Example                                          Example of Help Text                                 A longer block of help text that breaks onto a new line and may extend beyond one line.                    

Read More

Set a pill menu with Bootstrap

Samual Sam
Samual Sam
Updated on 11-Mar-2026 200 Views

To set a pill menu in Bootstrap, use the .nav nav-pills class in BootstrapExample           Bootstrap Example                                          Web Development          The following are the web dev technologies:                       HTML5             jQuery             JavaScript             CSS             Ajax             ES6                    

Read More

Separate links in the dropdown menu with a thin horizontal border with Bootstrap

Samual Sam
Samual Sam
Updated on 11-Mar-2026 317 Views

Use the .divider class in Bootstrap to separate links in the dropdown menu with a thin borderExample           Bootstrap Example                                          Beverages          The following are the beverages available in India:                       Beverages                                            Gatorade                Sting                Red Bull                                Pepsi                Coca Cola                                

Read More

Customize links using disabled class for unclickable links

Samual Sam
Samual Sam
Updated on 11-Mar-2026 260 Views

You can try to run the following code to customize links using disabled classExample           Bootstrap Example                                 Coding Examples       The following are the examples:                Code1          Code2          Code3          Code4          Code5                      ← Prev          Next →          

Read More

CopyOnWriteArraySet Class in Java

Samual Sam
Samual Sam
Updated on 11-Mar-2026 778 Views

Class declarationpublic class CopyOnWriteArraySet    extends AbstractSet implements SerializableCopyOnWriteArraySet class uses CopyOnWriteArrayList internally for all of its operations and thus possesses the basic properties of CopyOnWriteArrayList.CopyOnWriteArraySet is a thread-safe.CopyOnWriteArraySet is to be used in Thread based environment where read operations are very frequent and update operations are rare.Iterator of CopyOnWriteArraySet will never throw ConcurrentModificationException.Any type of modification to CopyOnWriteArraySet will not reflect during iteration since the iterator was created.Set modification methods like remove, set and add are not supported in the iteration. This method will throw UnsupportedOperationException.CopyOnWriteArraySet MethodsFollowing is the list of important methods available in the CopyOnWriteArraySet class.Sr.No.Method & ...

Read More

Callback using Interfaces in Java

Samual Sam
Samual Sam
Updated on 11-Mar-2026 4K+ Views

In the case of Event-driven programming, we pass a reference to a function which will get called when an event occurs. This mechanism is termed as a callback. Java does not support function pointers. So we can not implement the same direction. But using interfaces we can achieve the same very easily.In the example below, we've made a callback when a button is clicked. See the steps −Create an interface ClickEventHandler with a single method handleClick().Create a ClickHandler class which implements this interface ClickEventHandler.Create a Button class which will call ClickHandler when it's click method is called.Test the application.Example//Step 1: ...

Read More

Bootstrap .checkbox-inline class

Samual Sam
Samual Sam
Updated on 11-Mar-2026 796 Views

Use .checkbox-inline class to a series of checkboxes for controls to appear on the same line. You can try to run the following code to implement the .checkbox-inline classExample           Bootstrap Forms                                       Best IDE (You can select more than one)                             NetBeans IDE                                 Eclipse IDE                    

Read More
Showing 851–860 of 1,507 articles
« Prev 1 84 85 86 87 88 151 Next »
Advertisements