Help me to solve this problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sid09
    New Member
    • Aug 2014
    • 1

    Help me to solve this problem

    I have a File type array which is converted one by one into String type now i want to make an array of all converted string. Don't know how to and stuck here

    Code:
    FTPFile[] files = client.list();
    for (FTPFile file : files) {
          System.out.println(file.getName());
    //How to make an array of file.getName
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    i'm new too java too, but something like this (untested):
    Code:
        String[] strings ;
        int i = 0;
        FTPFile[] files = client.list();
        for (FTPFile file : files) {
              System.out.println(file.getName());
              strings[i++] = file.getName();
        //How to make an array of file.getName

    Comment

    Working...