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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:01:08+00:00 2026-06-13T21:01:08+00:00

In the process of doing some reflection on Java types, I came across an

  • 0

In the process of doing some reflection on Java types, I came across an oddity that I do not understand.

Inspecting int for its modifiers returns public, abstract, and final. I understand public and final, but the presence of abstract on a primitive type is non-obvious to me. Why is this the case?

Edit: I am not reflecting on Integer but on int:

import java.lang.reflect.Modifier;

public class IntegerReflection {
    public static void main(final String[] args) {
        System.out.println(String.format("int.class == Integer.class -> %b", int.class == Integer.class));
        System.out.println(String.format("int.class modifiers: %s", Modifier.toString(int.class.getModifiers())));
        System.out.println(String.format("Integer.class modifiers: %s", Modifier.toString(Integer.class.getModifiers())));
    }
}

The output when run:

int.class == Integer.class -> false
int.class modifiers: public abstract final
Integer.class modifiers: public final
  • 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-13T21:01:09+00:00Added an answer on June 13, 2026 at 9:01 pm

    If you run

    System.out.println(Modifier.toString(int.class.getModifiers()));
    

    you get

    public abstract final
    

    possibly because you can’t sub-class it – i.e. final, and you can’t instantiate it – i.e. abstract.

    From Oracle’s Abstract Methods and Classes

    Abstract classes cannot be instantiated, but they can be subclassed.

    The fact is its also final means it cannot be sub-classes.

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

Sidebar

Related Questions

I'm in the process of doing some advance IE8 testing, and it seems that
I'm in the process of doing some Java<->.NET interop code using a native library
In my application i am doing some process using progress bar at that time
I have a process that is doing some heavy maths with gl rather than
While doing some reading, I came across the terms Intermediate Language and 3AC. IL,
I've been doing some logging of object creation times in our open account process
I basically have a unix process running and it is doing some heavy processing
We're in the process of doing some performance optimization for a multi-tenant Web application.
I want to display a progress bar/wheel, when doing some process, for instance, on
I am doing some reverse engineering on a 3rd party program that is making

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.