Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (7k points)

I wanted to experiment with printf statement and my code is throwing error like this:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: The method printf(Locale, String, Object[]) in the type PrintStream is not applicable for the arguments (String, String, String) The method format(String, Object[]) in the type PrintStream is not applicable for the arguments (String, Calendar) at TestPrintf.main(TestPrintf.java:7)

I am using Eclipse IDE.

Can someone help me with this?

1 Answer

0 votes
by (13.1k points)

I would suggest you check the compiler compliance level is set to 1.5 or higher in your project.

You can do it like this:

Project->Properties->Java Compiler

If Enable project specific settings are not set, use the Configure Workspace Settings link to check the global compiler compliance level.

Looking for a Java tutorial? Check out the Java course from Intellipaat.

Related questions

0 votes
1 answer
asked Feb 18, 2021 in Java by Jake (7k points)
0 votes
1 answer
asked Feb 15, 2021 in Java by Jake (7k points)
0 votes
1 answer
asked Mar 4, 2021 in Java by Jake (7k points)

Browse Categories

...