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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:04:26+00:00 2026-06-04T12:04:26+00:00

I have the following void: public void load() { //loading big picture from the

  • 0

I have the following void:

public void load() {
//loading big picture from the Internet
}

And i want it to run in a new Thread.
I can call this procedure like this:

new Thread(new Runnable() {
public void run() {
load();
}
}).start();

or it would be better to modify this void:

public void load() {
new Thread(new Runnable() {
public void run() {
//loading big picture from the Internet
}
}).start();
}

and simply call it:

load();

Or there is no different?

  • 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-04T12:04:27+00:00Added an answer on June 4, 2026 at 12:04 pm

    Functionally, they are identical. There are designed details that might make you consider the first way over the other.

    You may want the first option if you had a lot of different threads that didn’t their own individual things but also called load(). In that case, you already had created the thread, so if they called load() you wouldn’t want/need to create another.

    The second option is very convenient. You can simply call load() wherever you want. If, in the future, the load() method changes to a point where it’s not blocking, then you can change it and no further code changes would be needed.

    Alternatively, consider using AsyncTask for this as previously suggested. It was specifically built for exactly what you’re trying to do.

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

Sidebar

Related Questions

I have the following code: public void run() { try { logger.info(Looking for new
I have the following method: public void PutFile(string ID, Stream content) { try {
I have the following code: public void BeginConvert(object data) { ConverterData cObject = (ConverterData)data;
I have the following code: public void post(String message) { final String mess =
Suppose i have the following method : public void runLoop(SomeIterator it){ while(it.hasNext()){ //do something
I have following code to traverse a tree (pre-order): public void traverse(Node node) {
I have following class public class ButtonChange { private int _buttonState; public void SetButtonState(int
I have following code: public static void ProcessStep(Action action) { //do something here if
I have following code public class TEST { public static void main(String arg[]){ try
I have the following Code : public GUIWevbDav() { InitializeComponent(); } private void Form1_Load(object

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.