public static String ipV4Address ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; sb . append ( "." ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; sb . append ( "." ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; sb . append ( "." ) ; sb . append ( JDefaultNumber . randomIntBetweenTwoNumbers ( 2 , 254 ) + "" ) ; return sb . toString ( ) ; }
generates a random IPv4 ip address like 192 . 168 . 2 . 100