| | |
for loop help?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2009
Posts: 15
Reputation:
Solved Threads: 0
I have this code:
This code run correctly.But when i dont use the second for loop.i couldnt work.I dont know? plz give me the answer.
Why do i need the second for loop?
Java Syntax (Toggle Plain Text)
/* package lab; public class Main { public static void main(String[] args) { int t=0; int h=0; int w=0; String Name="http://hcmiu.edu.vn/mail/cuem"; char[] ch=new char[Name.length()]; for(int i=0;i<Name.length();i++){ ch[i]=Name.charAt(i); for(int j=0;j<Name.length();j++){ if((ch[j]=='/')&&(ch[j+1]=='/')&&(Character.isLetter(ch[j+2]))){ t=j+2; System.out.println(t); h=Name.indexOf('/', j+3); } } } System.out.println(Name.subSequence(t, h)); } }
Java Syntax (Toggle Plain Text)
/* package lab; public class Main { public static void main(String[] args) { int t=0; int h=0; int w=0; String Name="http://hcmiu.edu.vn/mail/cuem"; char[] ch=new char[Name.length()]; for(int i=0;i<Name.length();i++){ ch[i]=Name.charAt(i); if((ch[i]=='/')&&(ch[i+1]=='/')&&(Character.isLetter(ch[i+2]))){ t=o+2; System.out.println(t); h=Name.indexOf('/', j+3); } } System.out.println(Name.subSequence(t, h)); } }
![]() |
Similar Threads
- Python loop help (Python)
- Web-Scrape Loop via CSV list of URLs ??? (Python)
- help in stored procedure-result of a loop using cursor (MS SQL)
- Loop...without the loop (Java)
Other Threads in the Java Forum
- Previous Thread: first ever program using more than one method
- Next Thread: Out of bounds and I don't know why
Views: 206 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
android api apple applet application arguments array arrays automation bidirectional binary birt bluetooth calculator chat class classes client code columns component database designadrawingapplicationusingjavajslider detection draw eclipse editor error errors event exception expand file fractal game givemetehcodez graphics gui guidancer helpwithhomework html ide image inetaddress input integer intellij j2me java javamicroeditionuseofmotionsensor javaprojects jme jmf jni jpanel julia linux list loop map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie number object oracle os plazmic print problem program programming project recursion scanner screen server set signing size smart sms smsspam socket sort sql string subclass support swing test threads time transfer tree windows





