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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:18:08+00:00 2026-06-03T14:18:08+00:00

I saw that javascript has something similar. Is it possible to do something like

  • 0

I saw that javascript has something similar.
Is it possible to do something like this in Android?
I know how to do it with array names, my question is about returning and assigning directly from the variables that compose the arrays.

private int[] calcHead() {
    int i;
    int j;
    int k;
    // Do stuff
    return {i, j, k};     <-- is this possible? (I am getting error: "The Method must return a result of type int[]")
}

private void otherFunc(){
    int a;
    int b;
    int c;

    {a, b, c} = calcHead();   <-- is this possible?
}
  • 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-03T14:18:11+00:00Added an answer on June 3, 2026 at 2:18 pm

    This is a rather basic question:
    Anyway :

    public int[] foo() {
        int i = 0;
        int j = 0;
        int k = 0;
        return new int[]{i,j,k};
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In javascript it's possible to do things like this: SomeObject.somefunction(function(someparameters){ //do some things. });
I saw JavaScript code which begins with with . That's a bit confusing. What
I need to build a PDF based on FDF. I saw that Adobe has
I'm simply not getting this to work. I saw that this network isn't for
Today, I got completely surprised when I saw that a global variable has undefined
We are working on a JavaScript application that does has been crashing for no
Today I saw a JavaScript syntax (when invoking a function) that is unfamiliar to
In several JavaScript libraries I saw this notation at the very beginning: /** *
Based on an answer I saw in this question: Link I'm wondering, is this
I saw very interesting example of using html5 css3 and javascript that is amazing,

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.