下面代码是关于Java将ip字符串转换成整数的代码,希望对各位有较大用途. public class IpUtil { public static int Ip2Int(String strIp){ String[] ss = strIp.split("\."); if(ss.length != 4){ return 0; } byte[] bytes = new byte[ss.length]; for(int i = 0; i < bytes.length; i++){ by
转自:http://blog.csdn.net/ld422586546/article/details/9707997 Java中父类强制转换成子类的原则:父类型的引用指向的是哪个子类的实例,就能转换成哪个子类的引用. 例: public class Test { public static void main(String[] args) { Person person = new Boy(); Boy boy = (Boy) person; boy.eat(); } } class P