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

The Archive Base Latest Questions

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

This might be a really stupid question but what happens to data that is

  • 0

This might be a really stupid question but what happens to data that is returned from a method? For example, if I have a method that adds two numbers and I tell it to return the sum, how would I access that information from the place where the method was called?

  • 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-14T00:32:06+00:00Added an answer on June 14, 2026 at 12:32 am

    Assuming your question is related with java.

    You could assign the whole method to a new variable.

    public class Test {
            public static void main(String args[]){
                int value1=2;
                int value2=5;
                int sum=sum(value1,value2);
                System.out.println("The sum is :"+ sum);
            }
    
            public static int sum(int value1,int value2){
                return value1+value2;   
            }
     }
    

    What is actually happening, is that the method signature sum(value1,value2) holds the result of the 2 numbers summation. There is also another way of writing the code inside the method but the result will be the same.

    For example:

    public class Test {
             public static void main(String args[]){
                int sum=sum(2,5);
                System.out.println("The sum is :"+ sum);
             }
    
             public static int sum(int value1,int value2){
                   int sum=value1+value2;               
                   return sum;  
             }
    }
    

    P.S. You could try to use the above samples directly. They will compile and run.

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

Sidebar

Related Questions

I might be very stupid to ask this question. But I really hav no
This might be a very stupid question :P But I found this really interessting:
This might be a really stupid and obvious question, but I'm very new to
This might be a really stupid question, but I can't find any information regarding
This might be a stupid question but i would really appreciate any compact answer.
This question might sound a bit stupid but here it goes. I have two
This might be a really stupid question, but I'm curious. A ping of youtube.com
This might seem like a stupid question but it's really bugging me. Basically, I
This might be a really stupid question and make you guys laugh. I've deployed
This might sound a silly question but I've really spend hours in trying to

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.