Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:58:40+00:00 2026-06-09T18:58:40+00:00

Eclipse keeps giving me the following error: Exception in thread main java.lang.Error: Unresolved compilation

  • 0

Eclipse keeps giving me the following error:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
input cannot be resolved
The method If(boolean) is undefined for the type bai1DinhLuatCuLong
Syntax error, insert ";" to complete Statement
F cannot be resolved to a variable

I do not understand this. What do I need to fix? Why can’t I use the If() function?

I’ve tried looking through Google and Bing, and I’ve double checked my Java examples book, but I could not work this out.

import java.util.Scanner;


public class bai1DinhLuatCuLong
{
    public static void main(String[] args)
    { 
    System.out.print("Giá trì cần tìm (F // q // r) : ");   
    char cantim = input.nextChar();

            // HERE THIS IS WHERE I PUT THE IF STATEMENT !!!
    If (cantim == 'F') {

        Scanner input = new Scanner(System.in); 
        System.out.print("Độ lớn của điện tích thứ nhất : ");
        double q1 = input.nextDouble();
        System.out.print("Độ lớn của điện tích thứ hai : ");
        double q2 = input.nextDouble();
        System.out.print("Khoảng cách giữa 2 điện tích : ");
        double r = input.nextDouble();
        System.out.print("Hệ số k sẽ tự động được đặt là 9*10^9 như trong hệ SI");
        double F = 9 * Math.pow(10,9) * Math.abs(q1) * Math.abs(q2) / Math.pow(r,2);
    }

    System.out.print("Độ lớn lực tương tác giữa 2 điện tích điểm : " + "\n Lưu ý E là *10");

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:58:41+00:00Added an answer on June 9, 2026 at 6:58 pm

    If does not have a large cap I in java: it should be if.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I programmed the following into Eclipse but the program keeps giving me the error:
I like formatting my Java code in Eclipse. It keeps the code well indented
Eclipse keeps auto formatting upon save, for example: it is insisting the following code
I'm trying to use the EPIC debugger in Eclipse and it keeps timing out.
Eclipse is showing the following errors in my Spring's applicationContext.xml : cvc-complex-type.2.4.c: The matching
my app keeps force closing before it starts... eclipse returns no errors in my
I have the following setup in my project: com.foo - Main com.foo.util - StringUtil
When I try to create a PlugIn Project in eclipse it keeps telling me,
I'm trying to install the google plugin for eclipse but the installer keeps telling
I use Eclipse for Java development. There is an *.exe file in a subdirectory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.