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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:01:55+00:00 2026-06-03T22:01:55+00:00

So I have been reading a tutorial on Android development, and I have come

  • 0

So I have been reading a tutorial on Android development, and I have come across something that I have never seen during my Java developing (mainly school work):

Thread th = new Thread() { 
    public void run() {
        if (iotdHandler == null) {
            iotdHandler = new IotdHandler(); 
        }
        iotdHandler.processFeed(); resetDisplay(
        iotdHandler.getTitle(), 
        iotdHandler.getDate(),
        iotdHandler.getUrl(),
        iotdHandler.getDescription());
        dialog.dismiss();
    }
};
th.start();

Now the book says extend thread, and I kind of understand what its doing, in a sense, but it doesn’t follow the usual way to extend a normal class in java like so:

public Class Dog extends Animal...

and then you can follow on and override methods and such. But my question is, what is it actually doing in making a reference to new Thread object, but at the same time creating a method right after it, and what I assume is overriding some sort of method in the Thread class? Since I do not know what it is called, I can’t really search for it, so I apologize for the obvious question if it is one. Any help would be much appreciated.

  • 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-03T22:01:57+00:00Added an answer on June 3, 2026 at 10:01 pm

    Revise your Java books 🙂 It’s called an anonymous inner class and was originally introduced to facilitate Java GUI development (with AWT/Swing). Since Android UI development follows many of the same patterns, it is used quite often in Android.

    What it does is instantiating a class in place (without defining it in a separate file, etc.), overriding some of its methods (int this case run()). You can also implement an interface this by if you provide implementations for all of its methods.

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

Sidebar

Related Questions

I have been developing a sample application after reading Rails 3 Tutorial book. In
Let me start by saying that I have been reading the drag'n drop tutorial
I've been reading through a nice tutorial and have a quick question concerning something
I've been reading the Beginning iPhone 4 Development book and they have one tutorial
I have been reading through the Java tutorial on RMI. I like the approach
I am currently trying to learn Android. Have been reading tutorials and manual for
I have been reading some django tutorial and it seems like all the view
I have been reading through what seems to be a good tutorial on rest
I have been reading a lot about how flash development/design had died, and as
I'm quite new to Android and I have been reading the Professional Android 2

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.