Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
CopyOnWriteArrayList Class in Java
Class declarationpublic class CopyOnWriteArrayList extends Object implements List, RandomAccess, Cloneable, SerializableCopyOnWriteArrayList is a thread-safe variant of ArrayList where operations which can change the ArrayList (add, update, set methods) creates a clone of the underlying array.CopyOnWriteArrayList is to be used in a Thread based environment where read operations are very frequent and update operations are rare.Iterator of CopyOnWriteArrayList will never throw ConcurrentModificationException.Any type of modification to CopyOnWriteArrayList will not reflect during iteration since the iterator was created.List modification methods like remove, set and add are not supported in the iteration. This method will throw UnsupportedOperationException.null can be added to the ...
Read MoreBootstrap .btn-lg class
To make a large button, use the .btn-lg class in Bootstrap.You can try to run the following code to implement the btn-lg classExample Bootstrap Example Large button
Read MoreAdd the default styles for the dropdown menu container in Bootstrap
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 MoreBootstrap .btn-link class
Deemphasize a button by making it look like a link while maintaining button behavior using the btn-link class in Bootstrap −Example Bootstrap Example Link Button
Read MoreCallback using Interfaces in Java
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 MoreCalling a method using null in Java
When a method is invoked on a null reference, it throws NullPointerException but in case of the static method, we can make it possible using cast expression. See the example below −Examplepublic class Tester { public static void display(){ System.out.println("display"); } private void print() { System.out.println("print"); } public static void main(String[] args) { //Scenario 1: //Calling a method on null reference //causes NullPointerException try { Tester test = null; ...
Read MoreBootstrap progress class
Use the .progress class in Bootstrap to create a progress bar. The class is a container for progress bars.You can try to run the following code to implement progress class in BootstrapExample Bootstrap Example 90% Complete
Read MoreBootstrap .btn-block class
To create a button using the .btn-block class, you can try to run the following code −Example Bootstrap Example The following are block level buttons: Block level Primary button Block level button
Read MoreAdd a fading effect when closing an alert box in Bootstrap
Use the .fade class in Bootstrap to add a fading effect when the alert is closed:Example Bootstrap Example Eclipse Refactoring × To refactor code in Eclipse, try the below given steps in the video (You can also close this alert)
Read MoreAdd plain text next to a form label within a form with Bootstrap
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