You can’t use the class name as the name for a method. The only “methods” that can share a name with the class are constructors.
One fix would be to rename your class from isPalindrome
to PalindromeFinder
or something. That would also better align with Java naming conventions.
EDIT: Note that you never actually called your method in main; you tryed to assign a local variable to isPalindrome
. That does not actually call the method. You would need to invoke the method with isPalindrome(...put your parameters here...)
and store the result in a variable with a name that isn’t being used.
Also note that a method can only return a single value (a single primitive or a single object). If you really want to return an array AND a boolean (and I’m not sure you do), you would have to store those in an object and return that object.
Related Posts:
- Converting array to list in Java
- What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it?
- Java Error “Exception in thread “main” java.util.InputMismatchException” On an Array program
- Working with a List of Lists in Java
- How to convert jsonString to JSONObject in Java
- what does “>>>” mean in java?
- How to convert List
to int[] in Java? - How to convert int[] into List
in Java? - In Java, how to append a string more efficiently?
- ow to create a histogram in java
- Java ArrayList for integers
- java.lang.ArrayIndexOutOfBoundsException: 4 Error
- Convert ArrayList
to java.util.List [closed] - Using the Pythagorean theorem with Java
- How to initialize an array in Java?
- Can’t start Eclipse – Java was started but returned exit code=13
- How do I declare and initialize an array in Java?
- Convert list to array in Java [duplicate]
- How to solve could not create the virtual machine error of Java Virtual Machine Launcher?
- “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
- What’s the simplest way to print a Java array?
- How to print elements in a vector c++
- “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
- Editor does not contain a main type in Eclipse [duplicate]
- Create ArrayList from array
- What is the difference between String[] and String… in Java?
- Are vectors passed to functions by value or by reference in C++
- JRE Missing when installing eclipse
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- Print ArrayList
- Make copy of an array
- Does JavaScript have a method like “range()” to generate a range within the supplied bounds?
- Array of arrays (Python/NumPy)
- Java – Best way to print 2D array?
- Server Tomcat v9.0 Server at localhost failed to start
- I want to declare an empty array in java and then I want do update it but the code is not working
- Calculating Standard Deviation & Variance in C++
- Control an Arduino with Java
- Cannot find “Package Explorer” view in Eclipse
- Javascript Uncaught TypeError: Cannot read property ‘0’ of undefined
- What is a list in Bash?
- What does ** do in C language?
- what does Dead Code mean under Eclipse IDE Problems Section
- Print ArrayList
- Convert array of strings into a string in Java
- How to create an empty array?
- How do I create an array of strings in C?
- Java – Best way to print 2D array?
- What is the difference between a null array and an empty array?
- How to change a package name in Eclipse?
- Are arrays passed by value or passed by reference in Java?
- What does << mean in Ruby?
- Eclipse “Error: Could not find or load main class”
- eclipse won’t start – no java virtual machine was found
- Convert String to int array in java
- eclipse won’t start – no java virtual machine was found
- “Actual or formal argument lists differs in length”
- Bubble sort algorithm in MIPS
- Eclipse returns error message “Java was started but returned exit code = 1”
- Resize an Array while keeping current elements in Java?
- Access restriction: The type ‘Application’ is not API (restriction on required library rt.jar)
- How to sort an array of objects in Java?
- Error: unsupported use of matrix or array for column indexing
- Weighted random selection from array
- How to make an array of arrays in Java
- How do I print out the value of this boolean? (Java)
- No appenders could be found for logger(log4j)?
- Syntax error on token(s), misplaced construct(s)
- Error occurred during initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)
- How to clear console in Java – Eclipse
- How to return a boolean method in java?
- Java read file and store text in an array
- Checking to see if array is full
- “The import org.springframework cannot be resolved.”
- How to sort an array in Bash
- How to use ArrayUtils for array of objects, it doesn’t delete the content of an array
- Printing char arrays in Java
- Fill an array with random numbers [duplicate]
- Java check if boolean is null
- Resource leak: ‘in’ is never closed
- Java console program
- Printing array elements with a for loop
- “Source folder is not a Java project” error in eclipse
- How do I initialize a byte array in Java?
- Eclipse Problems View not showing Errors anymore
- “Cannot be resolved to a type” when attempting to use Scanner
- java eclipse red exclamation mark
- Difference between char *argv[] and char **argv for the second argument to main()
- “insufficient memory for the Java Runtime Environment ” message in eclipse
- Which Eclipse IDE version to choose?
- How to get rows and columns count of a 2D array in Java?
- Eclipse IDE – Error: Build path specifies execution environment Java SE 1.7
- How can i fix this equals on primitive type(int)
- Error :- java runtime environment JRE or java development kit must be available in order to run eclipse
- Maven dependency update on commandline
- The import javax.servlet can’t be resolved
- What is the size of a boolean variable in Java?
- variably modified array at file scope in C
- Numpy matrix to array
- How do I enable index downloads in Eclipse for Maven dependency search?