Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Send File (path) as argument to method

  1. #1
    Banned
    Join Date
    May 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Send File (path) as argument to method

    convert.java
    public class convert {
     
    	/**
    	 * @param args
    	 */
    	public static void getnumber(String[] args) {
    		// TODO Auto-generated method stub
     
    	}


    main.java
    convert.getnumber(list[i].getAbsolutePath());


    Get this error:
    Description Resource Path Location Type
    The method convert(String[]) in the type main is not applicable for the arguments (String)

    How can I solve this?
    Last edited by efluvio; May 31st, 2011 at 12:33 PM.


  2. #2
    Member OutputStream's Avatar
    Join Date
    Apr 2011
    Posts
    32
    My Mood
    Fine
    Thanks
    1
    Thanked 4 Times in 3 Posts

    Default Re: Send File (path) as argument to method

    What are you trying to do? Where is the array named "list" declared?

  3. #3
    Banned
    Join Date
    May 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Send File (path) as argument to method

    Quote Originally Posted by OutputStream View Post
    What are you trying to do? Where is the array named "list" declared?
    It is properly declared. The list[] is a list of files read from a folder, and I want to pass them one by one to a method to do text file conversion.

  4. #4
    Banned
    Join Date
    May 2011
    Posts
    26
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Send File (path) as argument to method

    It was solved modifying the convert.java:
    public class convert {
     
    	/**
    	 * @param args
    	 */
    	public static void getnumber(String args) {
    		// TODO Auto-generated method stub
     
    	}

Similar Threads

  1. Relative path issue with Context path struts
    By chinnu in forum Web Frameworks
    Replies: 1
    Last Post: March 31st, 2011, 10:17 AM
  2. [SOLVED] Server Client does not send file
    By Kakashi in forum What's Wrong With My Code?
    Replies: 0
    Last Post: March 10th, 2011, 12:38 PM
  3. locating the path to a jar file within a program
    By nemo in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 2nd, 2011, 05:41 PM
  4. Making computer independent file path
    By Javabeginner in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: September 2nd, 2010, 03:56 PM
  5. Generic method using an int[] argument
    By dubois.ford in forum Collections and Generics
    Replies: 2
    Last Post: March 18th, 2010, 07:18 AM