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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:27:26+00:00 2026-06-11T02:27:26+00:00

So, here is a piece of my abstract class: abstract public void insert(Object obj);

  • 0

So, here is a piece of my abstract class:

abstract public void insert(Object obj);

And here is the implementation in a class that extends it:

public void insert(User u){
    try{
        String sql = "INSERT INTO " + TABLE + " (username, assword) VALUES ("+u.getUsername()+", " +u.getPassword()+")";
        conn.execSQL(sql);
    }catch(Exception e){
        System.out.println(e.getMessage());
    }finally{
        conn.close();
    }
}

and Here is the error:

The type — must implement the inherited abstract method —.insert(Object) userDAO.java

Basically, it is saying to me that I didn’t implement any method that is called “insert” and receives an object as parameter. Doesn’t my model “User” count as an object? What am I doing wrong here?

Thanks for your attention.

Ps.: error message on Eclipse while developing an Android App (I don’t know if it changes anything).

  • 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-11T02:27:27+00:00Added an answer on June 11, 2026 at 2:27 am

    Your method signature is incorrect, base and derived methods take different objects. Let me try and explain:

    Assume you have a class Base which takes an instance of another class B1 in one of its methods (say m1). Also assume that you have a Derived class Derived1 which overrides the method (m1) in Base with the parameter D1 and similarly a derived class Derived2 which overrides the base method with parameter D2.

    Both D1 and D2 implement/extend B1. This will be a problem because of the following scenario:

    Base baseObj = new Derived1();
    baseObj.m1(new D2()); // Should work if it is allowed to override a method in your way!
    

    The above code snippet fails because the m1 method in Derived1 expects a parameter of type D1, but it got D2. Do you now see why this type of parameter casting is not permitted?

    Note: It is a good practice to use @override annotation when overriding a method in base (from Java 1.5 specification)

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

Sidebar

Related Questions

Here's a piece of code I'm using: public void Start() { Dns.BeginGetHostEntry(www.google.com, new AsyncCallback(Stop),
Here is my piece of code that creates buttons programmatically: NSArray *buttonImage=[NSArray arrayWithObjects:[UIImage imageNamed:@Cover_0.png],
Here is the piece of code that I have used for Java 5.0 TreeSet<Integer>
Here's a piece of code from the xss_clean method of the Input_Core class of
Here's a piece of code that takes most time in my program, according to
I have here a piece of code that record the number of bottles collected
Here's a piece of code that I've written to check if the sum of
Here is my piece of code : <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
Say I have an array of pointers to an abstract class: Piece *pieces[2]; //
Here a piece of my fork-server code: signal (SIGINT, ( void *)sig_handler); while(1){ memset(&cli_addr,

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.