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

  • Home
  • SEARCH
  • 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 8952999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:59:56+00:00 2026-06-15T13:59:56+00:00

For some reason I get a syntax error that says, Syntax error, insert }

  • 0

For some reason I get a syntax error that says, “Syntax error, insert “}” to complete ClassBody.” I checked every method, every statement to make sure I have complete opening and closing brackets, so I don’t know why this is happening. Can anybody tell me why I might be getting this issue?

Copying the code into another file doesn’t fix the problem, nor does going to Project > Clean.

import java.util.Scanner;

public class jloneman_Numerology
{
    private String[] report;
    private int day, month, year, num;

    public jloneman_Numerology()
    {
        introduction();
        report = new String[9];
        num = 0;
    }

    public void introduction()
    {
        System.out.println("Welcome to ACME Numerology Reports! We will " +
                "determine your special\nnumerology report based on your " +
                "birth date.\n");
    }

    public void getDate()
    {
        char slash1, slash2;

        do
        {
            System.out.print("Please enter your birth date (mm / dd / yyyy): ");
            Scanner in = new Scanner(System.in);
            String date = in.nextLine();

            month = in.nextInt();
            day = in.nextInt();
            year = in.nextInt();

            slash1 = date.charAt(3);
            slash2 = date.charAt(8);
        } while (validDate(slash1, slash2) == false);

        calcNum();
    }

    public boolean validDate(char slash1, char slash2)
    {
        boolean isValid = true;

        // Check for valid month
        if (month < 1 || month > 12) 
        {
            isValid = false;
            System.out.printf("Invalid month: %d\n", month);
        }

        // Check for valid day
        if (day < 1 || day > 31)
        {
            isValid = false;
            System.out.printf("Invalid day: %d\n", day);
        }

        // Check for months with 30 days, else 31 days = invalid
        if ((month == 4 || month == 6 || month == 9 || month == 11) && (day < 1 || day > 30))
        {
            isValid = false;
            System.out.printf("Invalid day: %d\n", day);
        }
        else if (day < 1 || day > 31)
        {
            isValid = false;
            System.out.printf("Invalid day: %d\n", day);
        }

        // Check for valid year
        if (year < 1880 || year > 2280) 
        {
            isValid = false;
            System.out.println("Please enter a valid year between 1880 and 2280.");
        }

        // Check for correct separating character
        if (slash1 != '/' || slash2 != '/')
        {
            isValid = false;
            System.out.println("Invalid separating character, please use forward slashes");
        }

        if (leapYear() == true)
        {
            if (month == 2 && day > 29)
            {
                isValid = false;
                System.out.printf("Invalid day for 2/%d: %d", year, day);
            }
        }

        return isValid;
    }

    public boolean leapYear()
    {
        boolean isLeap;

        if (year % 4 == 0 && year % 400 != 0)
            isLeap = false;
        else
            isLeap = true;

        return isLeap;
    }

    public void calcNum()
    {
        // Separate each digit of the date and add to a single number

        // Test number for debugging
        num = 5;
    }

    public void printReport()
    {
        report[0] = ":1: ";
        report[1] = ":2: ";
        report[2] = ":3: ";
        report[3] = ":4: ";
        report[4] = ":5: ";
        report[5] = ":6: ";
        report[6] = ":7: ";
        report[7] = ":8: ";
        report[8] = ":9: ";

        System.out.println(report[num]);
    }
}

                                                                                                                                                  78,0-1        Bot
  • 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-15T13:59:57+00:00Added an answer on June 15, 2026 at 1:59 pm

    Try removing (or commenting out) one method and see if the problem persists. If it does, remove or comment out an additional method, and so on, until the error disappears. Then restore everything but the last method.

    If the error doesn’t reappear, the problem is probably in that last method.

    If it does reappear, the problem is more subtle; perhaps a control character embedded in the code. Try copying and pasting the code into a text-only editor (so any control characters will be ignored, save it, and recompiling.

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

Sidebar

Related Questions

I am reading in a file and for some reason i get a syntax
For some reason I cannot get the error logging to work, I'm getting the
This is kind of embarrassing but I cannot for some reason get his CSS
For some reason I get some warnings about non dll-interface class when building with
I have a search setup inside a div but for some reason cannot get
I can run the following query in PHPMyAdmin, but for some reason I get
I use CSS transitions fairly regularly and for some reason I cannot get them
For some reason I can't get this to work. It pulls the name and
For some reason I can't get this script to run when I add the
For some reason i can't get the variable 'total' to define at all... I

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.