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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:20:44+00:00 2026-05-28T00:20:44+00:00

Why javac looks for .java extensions in filenames. While java doesn’t look for .class

  • 0

Why javac looks for .java extensions in filenames.
While java doesn’t look for .class in its argument? And goes to the .class file by itself automatically?
Is there any reason for this?

  • 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-28T00:20:45+00:00Added an answer on May 28, 2026 at 12:20 am

    There’s no automatic adding of .class: you just run java specifying which class to use as main. The details of classloading and classpath are on a different level of abstraction: it is possible that there’s no .class file, or e.g. it’s in a JAR.

    If you look closer, by the way, you’ll find that java does not ask you for a path: there are no slashes (or, worse yet, backslashes) in the parameters, only the proper dots separating package names. So it’s never a “file.”

    javac, on the other hand, does indeed work with files, hence you need to specify those.

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

Sidebar

Related Questions

I've got a simple java class that looks something like this: public class Skin
I'm currently working on Mangler's Android implementation. I have a java class that looks
why java Object class has two methods hashcode() and equals()? One of them looks
So we have a java class with two ArrayLists of generics. It looks like
I'm looking a way to build conditional assignments in bash: In Java it looks
Java EE 6 looks exciting. It will include the Servlet 3.0 spec, EJB3.1 Lite,
I have written a java annotation that looks like this: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) // can
It looks quite easy to find such a tool for Java ( Checkstyle ,
In Java 1.4 you could use ((SunToolkit) Toolkit.getDefaultToolkit()).getNativeWindowHandleFromComponent() but that was removed. It looks
I have a very simple Java RMI Server that looks like the following: import

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.