public class VerifierAddress {
منطقي ثابت isCorrect(String adr){
String[] parts = adr.split("\\.");
//يتراوح نطاق الرقم بين 0 و 255
for(int i = 0 ؛ i < 4 ؛ i ++) {
//تحويل إلى عدد صحيح واختبار
if (عدد صحيح جديد (أجزاء [i])< 0 || عدد صحيح جديد (أجزاء [i])> 255)
// retroune false
إرجاع false ؛
}
// إرجاع true افتراضيا
إرجاع true ؛
}
الفراغ الثابت العام الرئيسي (سلسلة [] args) {
سلسلة adr = "192.168.1.3" ؛
System.out.println ("adr +" هو "+ isCorrect(adr));
}
}
Please disable your ad blocker and refresh the window to use this website.