IPv6 validation is failing with java.net.InetAddress
Facing problem with java.net.InetAddress class while validating special form of IPv6 address.
please check the following piece of code.
String ipv6 = "0:0:0:0:0:ffff:a1f:e403";
final Inet6Address i6 = (Inet6Address) InetAddress.getByName(ipv6);
System.out.println("Not a proper ip: "+e);
It is throwing ClassCastException.
Re: IPv6 validation is failing with java.net.InetAddress
Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.
Please post your code correctly per the above link.