Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

"incompatible types - found int but expected boolean"

Posted on 2006-11-16
1
Medium Priority
?
1,860 Views
Last Modified: 2012-05-05
   public static boolean word_thousands(int main_numIn)
    {
        if (main_numIn = 1)
        {
            System.out.print("One");
            return true;
        }
        else
        {            
            return false;
        }

got this error: "incompatible types - found int but expected boolean" at line

if (main_numIn = 1)

anyone know how to fix this?
0
Comment
Question by:ishcmc
1 Comment
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 2000 total points
ID: 17963339
> if (main_numIn = 1)
suould be

if(main_numIn == 1)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question