Click here to Skip to main content
15,868,119 members
Home / Discussions / Java
   

Java

 
AnswerRe: Username ,Password Validation Pin
jschell24-Jul-13 9:48
jschell24-Jul-13 9:48 
GeneralRe: Username ,Password Validation Pin
chdboy24-Jul-13 22:28
chdboy24-Jul-13 22:28 
QuestionObject mutability Pin
Neo1010121-Jul-13 3:03
Neo1010121-Jul-13 3:03 
AnswerRe: Object mutability Pin
Richard MacCutchan21-Jul-13 20:33
mveRichard MacCutchan21-Jul-13 20:33 
GeneralRe: Object mutability Pin
Neo1010122-Jul-13 0:32
Neo1010122-Jul-13 0:32 
GeneralRe: Object mutability Pin
Richard MacCutchan22-Jul-13 1:44
mveRichard MacCutchan22-Jul-13 1:44 
Questioncomplete spring example to get datasource from websphere Pin
swarjava20-Jul-13 7:03
swarjava20-Jul-13 7:03 
QuestionProblem Array and looping Ip address,How? Pin
tolulan18-Jul-13 23:37
tolulan18-Jul-13 23:37 
Greetings all.
I have a program calculation ip address like this.
Java
public static void main(String[]args){
        int host=450;
        String sMask="255.255.254.0";
        String[] octet;
        String IpAddress="192.168.100.0";
        octet = IpAddress.split("\\.");
        int oct1=Integer.parseInt(octet[0]);
        int oct2=Integer.parseInt(octet[1]);
        int oct3=Integer.parseInt(octet[2]);
        int oct4=Integer.parseInt(octet[3]);
        int i;
        System.out.println("Ip Address \t \tSubnet Mask");
        for(i=oct4;i<host;i++){
            System.out.println(oct1+"."+oct2+"."+oct3+"."+i+"\t \t"+sMask);
        }
    }


Confused | :confused:
print out from this program

Ip Address Subnet Mask
192.168.100.0 255.255.254
192.168.100.1 255.255.254
192.168.100.2 255.255.254
192.168.100.3 255.255.254
until...
192.168.100.449 255.255.254
Laugh | :laugh: I want this program,if ip address octet 4 value "192.168.100.255",then continuing this program,like this.

next >
192.168.101.0 255.255.254
192.168.101.1 255.255.254
192.168.101.2 255.255.254
until ...
192.168.101.193 and Finish.

What the lack from my program?
AnswerRe: Problem Array and looping Ip address,How? Pin
Richard MacCutchan18-Jul-13 23:57
mveRichard MacCutchan18-Jul-13 23:57 
GeneralRe: Problem Array and looping Ip address,How? Pin
terry.schoof25-Jul-13 10:31
professionalterry.schoof25-Jul-13 10:31 
GeneralRe: Problem Array and looping Ip address,How? Pin
Richard MacCutchan25-Jul-13 21:06
mveRichard MacCutchan25-Jul-13 21:06 
GeneralRe: Problem Array and looping Ip address,How? Pin
terry.schoof26-Jul-13 8:25
professionalterry.schoof26-Jul-13 8:25 
QuestionNeed help to capture signature on a tablet Pin
Mehwish Wajiuddin16-Jul-13 20:55
Mehwish Wajiuddin16-Jul-13 20:55 
Questionthe problem about when tomcat was installed as a NT service Pin
xiaobai137916-Jul-13 16:51
xiaobai137916-Jul-13 16:51 
AnswerRe: the problem about when tomcat was installed as a NT service Pin
jschell17-Jul-13 8:45
jschell17-Jul-13 8:45 
GeneralRe: the problem about when tomcat was installed as a NT service Pin
xiaobai137918-Jul-13 20:01
xiaobai137918-Jul-13 20:01 
QuestionTrying to understand Puzzle4..Head First Pin
Skytten15-Jul-13 7:00
Skytten15-Jul-13 7:00 
AnswerRe: Trying to understand Puzzle4..Head First Pin
Richard MacCutchan15-Jul-13 22:12
mveRichard MacCutchan15-Jul-13 22:12 
GeneralRe: Trying to understand Puzzle4..Head First Pin
Skytten16-Jul-13 0:02
Skytten16-Jul-13 0:02 
GeneralRe: Trying to understand Puzzle4..Head First Pin
Richard MacCutchan16-Jul-13 0:14
mveRichard MacCutchan16-Jul-13 0:14 
GeneralRe: Trying to understand Puzzle4..Head First Pin
Skytten16-Jul-13 5:12
Skytten16-Jul-13 5:12 
GeneralRe: Trying to understand Puzzle4..Head First Pin
Richard MacCutchan16-Jul-13 5:16
mveRichard MacCutchan16-Jul-13 5:16 
GeneralRe: Trying to understand Puzzle4..Head First Pin
terry.schoof26-Jul-13 8:42
professionalterry.schoof26-Jul-13 8:42 
GeneralRe: Trying to understand Puzzle4..Head First Pin
Richard MacCutchan26-Jul-13 21:57
mveRichard MacCutchan26-Jul-13 21:57 
GeneralRe: Trying to understand Puzzle4..Head First Pin
terry.schoof27-Jul-13 8:05
professionalterry.schoof27-Jul-13 8:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.