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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:04:32+00:00 2026-06-16T20:04:32+00:00

I have abstract class and interface like this abstract class ParentClass { int VALUE;

  • 0

I have abstract class and interface like this

abstract class ParentClass
{
    int VALUE;
    public abstract void display();
    public void display2()
    {
        System.out.println("this is abstract class method");
    }
}

interface parentInterface
{
    int VALUE=88;
    abstract void display();
    void display2();
}

the child class extends and implements the above like following

class ChildClass extends ParentClass implements parentInterface
{

    ChildClass()
    {
        super.VALUE=0;
        //VALUE=0;     //<=will give ambiguous property
    }
    @Override
    public void display() 
    {
        System.out.println("Current Class-"+this.getClass());
        System.out.println("Integer value-"+super.VALUE);
    }
    public void display2()
    {
        //to call the method of abstract class 
        //call by using super.display2();
        System.out.println("this is implemented method");
    }
}

So, my question is How can i access interface VALUE variable in ChildClass ??

  • 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-16T20:04:33+00:00Added an answer on June 16, 2026 at 8:04 pm

    You can access the VALUE from interface using parentInterface.VALUE as variables in interfaces are public static final by default.

    And the abstract class’s VALUE can be accessed using this.VALUE as it is a member variable.

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

Sidebar

Related Questions

I have a class like so: public abstract class ClassA<T> { protected ClassA(IInterface interface)
I have this simple interface/class: public abstract class Message {} public class Message1 extends
I have a couple of POCO objects that look like this: public abstract class
I have some classes that look like this: MODEL public abstract class BaseEntity<O extends
I want something like this public abstract class abc { public abstract void test();
I have an abstract base class called WidgetBase which looks like this: public abstract
I have an interface: public abstract class Authorizer<T> where T : RequiresAuthorization { public
I have abstract BaseController, which basically looks like below: public abstract class BaseController :
I have an abstract class that implements IDisposable, like so: public abstract class ConnectionAccessor
I have an interface Tree and an abstract class RBTree which implements this interface.

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.