96229/logger-cannot-be-resolved-java-570425394-error-occured
//The MethodLog((Level,String)in the type logger is not applicable for the arguments(System.logger.Level.string) java [39,41] //The MethodLog((Level,String)in the type logger is not applicable for the arguments(System.logger.Level.string) java [37,43] //Two error occured. package tasks; import java.lang.System.Logger.Level; import java.util.logging.Logger; public class SmallestPositiveNumber { /* * Input: Array of numbers * * Output: Print the smallest positive number in the array & its position * * Sample input 1: Array - [10, 25, 100, 0] Sample output 1: * "Smallest positive number in the array is '0' & its position is '3'" * * Sample input 2: Array - [1, 2, 10, 5] Sample output 2: * "Smallest positive number in the array is '1' & its position is '0'" * * Sample input 3: Array - [1, 2, 10, -5] Sample output 3: * "Input contains negative value. Provide positive numbers" */ public static void main(String[] args) { int arr[] = { 10, 50, 32, 59, 37 }; int minimum = 0; int position = 0; for (int i = 0; i < arr.length; i++) { if (arr[i] > 0 && minimum >= 0) { if ( arr[i] < minimum) { minimum=arr[i]; position=i; } else { Logger.getAnonymousLogger().log(Level.INFO, "Input contains negative value. Provide positive numbers"); } } Logger.getAnonymousLogger().log(Level.INFO, "Smallest number in the array is" + minimum + "& its position is " +position); } } }
Hi, @Boopathy,
Changing the JRE System Library might work.
Hope this helps!
Check out Java Certification course here to know more.
Thanks!
Hey Techies, Non-static variables are part of the objects ...READ MORE
Hello @kartik, See the first line of your ...READ MORE
There are combinations of Operating System, JDK ...READ MORE
A subclass inherits all of the public ...READ MORE
You can use Java Runtime.exec() to run python script, ...READ MORE
First, find an XPath which will return ...READ MORE
See, both are used to retrieve something ...READ MORE
Nothing to worry about here. In the ...READ MORE
The "Cannot find symbol" errors generally occur when you ...READ MORE
To define Global Variable you can make ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.