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 6217931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:30:43+00:00 2026-05-24T07:30:43+00:00

I am writing a simple program: class Demo{ public static void main(String[] args){ system.out.println("Hello");

  • 0

I am writing a simple program:

class Demo{
    public static void main(String[] args){
        system.out.println("Hello");
    }
}

on compilation it gives an error: package system not found.
Why it do so that package not found instead system is a misspelled class name.

  • 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-05-24T07:30:43+00:00Added an answer on May 24, 2026 at 7:30 am

    Why it do so that package not found instead system is a misspelled class name

    When you say something.somethingElse the compiler assumes you are doing a packageName.classname. In this case you were intending to access out of the System class, but you could very well be trying to access a package called system that is not present (in the classpath for instance). So it is a guess from a compiler.

    And (I guess) it is so because this is the better guess. Let’s say the compiler said class not found. You might be happy. But tons of others doing Java.util.List (instead of java.util.List) would complain “I was trying to access the java.util package but misspelled it. The compiler wrongly says Missing class name.

    Update (for the sake of completeness)
    From @paxdiablo’s answer below:

    The reason why the compiler is assuming it’s a package name rather
    than a class or variable name lies in section 6.5 of the JLS,
    “Determining the meaning of a name”

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

Sidebar

Related Questions

I'm writing a simple program. There is only one class in it. There is
Out of curiosity about reverse engineering, I am thinking of writing a simple program
I'm just starting out writing trying to write a simple program in C and
I was writing a simple genetic program to test out the process, but got
I am writing a program for a class that is very simple. All it
I'm writing simple program to communicate between smart devices and I receive 11001 when
I'm writing a simple program to browse the local network and pass on filenames
I'm writing a simple program to help generate orders for a game I'm a
I am writing a simple program, which is trying to find next palindrome number
I'm writing a simple program that will run entirely client-side. (Desktop programming? do people

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.