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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:02:10+00:00 2026-06-05T11:02:10+00:00

I appeared for an Interview today . the interviewer asked me to write a

  • 0

I appeared for an Interview today . the interviewer asked me to write a thread in java 1.5
.Either you can extend java.lang.thread class or implement java.lang.Runnable interface.
Is it possible that implemented run() method have a return type other than void.
The method signature in Runnable interface is

public void run();

My answer was “you can not return an int or string from a run() method because of above signature definition.”

the interviewer said in java 1.5 you can return int or string from run method.

can you all please tell me how it can be done ?

I tried below it gave compilation error :

public class SampleInterview implements Runnable {
    @Override
    public int run() {
        System.out.println("Start : inside run of SampleInterview");
        System.out.println("End : inside run of SampleInterview");
    }
}

I have searched google also could not find any such way. Is it possible or not ?

  • 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-05T11:02:13+00:00Added an answer on June 5, 2026 at 11:02 am

    It’s not possible; either you misunderstood the interviewer, or they were wrong. (You might just “write the return value into some shared variable,” but that doesn’t seem like it meets the requirements.)

    The Callable interface, though, lets you return a value.

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

Sidebar

Related Questions

Today, I appeared for an interview and the interviewer asked me this, Tell me
I have created simple Java class to test file writes from applets: update appeared
I used Java to copy file but it appeared a exception (the system can
While considering another problem one question appeared. I do not know how to write
This is a problem appeared in today's Pacific NW Region Programming Contest during which
Just what the title states; the term appeared in 'Java Concurrency in Practice'. I
I am developing a small Java EE Hibernate Spring application and an error appeared:
if i want that i can detect the link appeared in my HTMLstring in
On the xkcd site today, the following appeared as a joke in a <script
I'm working through some sample code and then this appeared: public abstract class RandomPool<T>

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.