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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:31:22+00:00 2026-05-17T00:31:22+00:00

I come from a java background, I know how to call methods from objects

  • 0

I come from a java background, I know how to call methods from objects but would the following be impossible?

main(){
     int v1=2;
     int v2=3:
     int sum;
     sum = [Add: (int) v1, (v2)];
}
add ((int) v1, (int) v2)){
    return v1+v2;
}

And my second question, How would I define a variable that is static throughout every instance of an object. For example, If i want the variable tax_rate to be .07 in every instance of an object.

  • 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-05-17T00:31:23+00:00Added an answer on May 17, 2026 at 12:31 am

    Methods are written and invoked a bit differently in Objective-C. A method definition might look like this:

    - (int)addThis:(int)v1 andThat:(int)v2
    {
        return v1 + v2;
    }
    

    And you would invoke it like so:

    int v1 = 2;
    int v2 = 3;
    int sum = [self addThis:v1 andThat:v2];
    

    The syntax with the brackets is just for methods on objects (or classes). If you’re calling a plain old function, the syntax is the same as in C.

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

Sidebar

Related Questions

I come from a java background. But I would like a cross-platform perspective on
I come from Java Background and so used to Debugging using Eclipse but have
I'm new to PHP but come from a Java background and I'm trying to
I'm new to Python and come from a Java background. I'd like to know
I come from a java background, but I'm working on a django-based website. To
I'm new to Kohana but come from a Spring/Java background. In Spring I'm used
Sorry if the question is silly. I come from java background. In the following
I come from a C++/Java background, but I'm having problems getting the syntax right
I come from a Java background and am getting more into .NET, what are
I come from a Java background and have been using C# for the last

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.