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 3 of 3

Thread: Error using printf function across classes

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Error using printf function across classes

    Hi I am just but a beginner in java programming, I am trying to run a simple program that accesses multiple methods from another class. One of my methods has a String return type.
    In the next method I proceed to use the printf function to output the string returned in the previous method but then when i ran my program the first time there were errors and now when I try to run again the class with the main function does not show up in the list of resources to save.
    When I hover the cursor on the red cross that highlights an error on a line of code, it says: Multiple markers at this line
    - The method printf(String, Object[]) in the type PrintStream is not
    applicable for the arguments (String, String)
    - The method printf(String, Object[]) in the type PrintStream is not
    applicable for the arguments (String, String)
    How can I correct this? Thanks in advance.


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Manila, Philippines
    Posts
    285
    My Mood
    Amused
    Thanks
    6
    Thanked 64 Times in 61 Posts

    Default Re: Error using printf function across classes

    it would be better it you post of your code.

  3. #3
    Member
    Join Date
    Sep 2013
    Posts
    68
    My Mood
    Confused
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default Re: Error using printf function across classes

    Check java version you are using, it is possible that you have Java compiler compliance level 1.4.

Similar Threads

  1. Replies: 3
    Last Post: May 8th, 2014, 06:25 AM
  2. Replies: 1
    Last Post: April 6th, 2014, 02:49 AM
  3. Why am I getting a <No Main Classes Found> error message?? Help please!!
    By Rick Sebastian in forum What's Wrong With My Code?
    Replies: 13
    Last Post: February 9th, 2013, 07:04 PM
  4. [SOLVED] printf error
    By Thor in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 10th, 2012, 10:05 PM
  5. [SOLVED] Error: Null Exception on Array of classes
    By g000we in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 15th, 2010, 09:14 AM