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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:15:14+00:00 2026-05-26T05:15:14+00:00

This is regarding java. This is question asked in a interview.

  • 0

This is regarding java. This is question asked in a interview.

  • 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-26T05:15:15+00:00Added an answer on May 26, 2026 at 5:15 am

    This http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#40222 that contains the specifications of the The JavaTM Virtual Machine Specification, doesn’t seem to give limits.

    It probably was a trick question.

    I would say that there are limits. Probably you can’t have a .java file 4gb big, so extrapolating from that number you can say that there are probably less than some hundred million classes that can be inner classes of a class.

    If we consider this 4gb file limit an hard limit, and we say that we want all the inner classes to be 6 character (AZaz09) long,

    class A12345{}
    

    It’s 14 characters.

    And it is correct to write:

    class A12345{}class A12346{}class A12347{} // and so on
    

    Now, 4gb / 14 characters = 300 million inner classes. So I’m quite sure the maximum number is < 300 million inner classes.

    Now, if you are REALLY interested on hard numbers, tomorrow I’ll make a program able to create some hundred million inner classes and I’ll try to see on my computer with Windows Java 1.7 64 bits how much big a source file can be.

    I’ll add that the right response would be something similar “is it really important if it’s 100 or 1000 or one million? How many inner classes would you put in a class? In years of programming I haven’t ever put more than 3 or 4 in a class. But perhaps your programmers love to write single class files long more than 10000 lines of code.”

    And taking from the hourse mouth (the Sun Java site): Files longer than 2000 lines are cumbersome and should be avoided. Clearly it is only a recommendation.

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

Sidebar

Related Questions

After reading this question , I was reminded of when I was taught Java
First of all there is a partial question regarding this, but it is not
This is a question regarding Unix shell scripting (any shell), but any other "standard"
This is a very specific question regarding MySQL as implemented in WordPress . I'm
Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the
Disclaimer: This is for a homework assignment, but the question is not regarding the
I asked a question some time ago on java 2d pathfinding... Pathfinding 2D Java
Right now I'm reading this article regarding Java Garbage Collection: http://www.javaworld.com/javaworld/jw-08-1996/jw-08-gc.html ? Here is
I'd have a question regarding java SocketChannel. Say I have a socket channel opened
i'm reposting this question because i'm not sure if i asked it correctly before.:)

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.