Java JSP – JSTL Date Format Example

This example show how to format date in JSP using format tag library.


Java – Generic Constructor Example

Output:

value: 100.0
value: 123.5

Java – Get MAC Address

Since JDK 1.6, Java developers are able to access network card detail via NetworkInterface class. In this example, we show you how to get the localhost MAC address in Java.

Output:

Current IP address : 192.168.1.22
Current MAC address : 00-26-B9-9B-61-BF

Note: The NetworkInterfaceNetworkInterface.getHardwareAddress() method is only allowed to access localhost MAC address, not remote host MAC address.