Results 1 to 5 of 5
  1. #1
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default how to print the String Array?

    i want to print the String Array..my code is here

    Java Code:
    System.out.println(WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL));
    The Return type of .FD_ALL is string Array.

    I got error like this : The method getGlobalLogValue(String) in the type WMSLoggerFactory is not applicable for the arguments (String[])

    how can i print this String?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Break that up in two lines to properly see where the error originates.
    Java Code:
    Object logValue = WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL);
    System.out.println(logValue);
    db

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,662
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by DarrylBurke View Post
    Break that up in two lines to properly see where the error originates.
    Java Code:
    Object logValue = WMSLoggerFactory.getGlobalLogValue(WMSLoggerIDs.FD_ALL);
    System.out.println(logValue);
    db
    No, that's not it: the method getGlobalLogValue( ... ) needs a String type argument and a String[] is supplied; the compiler whines about it (and correctly so). I don't know if converting the String[] to a a String by using the Arrays.toString( ... ) method will help ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    nirasiva is offline Member
    Join Date
    May 2011
    Location
    chennai
    Posts
    29
    Rep Power
    0

    Default

    Thank you Sir

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    Quote Originally Posted by JosAH View Post
    No, that's not it: the method getGlobalLogValue( ... ) needs a String type argument and a String[] is supplied; the compiler whines about it (and correctly so).
    That's exactly what I meant, in the context of the (incorrect) subject line.

    db

Similar Threads

  1. using for-loop to print out a string
    By baumboards in forum New To Java
    Replies: 27
    Last Post: 03-17-2011, 04:47 PM
  2. Replies: 3
    Last Post: 02-03-2011, 10:19 PM
  3. Print Array as String through class file?
    By ocarabal in forum New To Java
    Replies: 3
    Last Post: 06-08-2010, 05:22 AM
  4. Print String from an Array
    By adityasirohi in forum New To Java
    Replies: 2
    Last Post: 02-18-2010, 04:10 PM
  5. I can only print string literals
    By leeavital in forum New To Java
    Replies: 1
    Last Post: 12-11-2009, 01:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •