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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:51:22+00:00 2026-05-20T21:51:22+00:00

I have just started out in Vala, and I tried to make a simple

  • 0

I have just started out in Vala, and I tried to make a simple program that asks two inputs:

  1. An int that specifies a cycle degree; and
  2. A char that contains I / R for either an iterative or recursive process.

Just before compiling, I got this error:

test0.vala:8.5-8.16: error: Access to instance member `test0.test_exec' denied
        test_exec(q);
        ^^^^^^^^^^^ //the entire statement
Compilation failed: 1 error(s), 0 warning(s)

The pastebin for the very simple program is located here.

Here’s a snippet:

public static void main(string[] args)
{
    stdout.printf("Greetings! How many cycles would you like? INPUT: ");
    int q=0;
    stdin.scanf("%d", out q);
    test_exec(q);
}

public void test_exec(int q)
{
    //method code here
}

Can you please enlighten me about what to do, and some tips? Thanks.

  • 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-20T21:51:22+00:00Added an answer on May 20, 2026 at 9:51 pm

    You defined test_exec as an instance (non-static) method. Unlike a static method, an instance method needs to be called on an instance of the given class. However you’re trying to call it without such an instance and thus get an error.

    So you either need to create an instance of the test0 class and call test_exec on that (though that would make little sense since test_exec does not depend on or change any state of the object – as a matter of fact the test0 class does not have any state) or make test_exec as well as the other methods called by test_exec static.

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

Sidebar

Related Questions

I have just recently started out programming for Android, and have decided that I
We have just started out with Team Foundation Server 2008 / Visual Studio Team
I have just started out with testing some php mvc framework In it, it
I just started out with C and have very little knowledge about performance issues
I just started out using wordpress as a CMS. On the site I have
I have just started using RSpec and I copied the very simple test on
I've only just started out with CF9's ORM features, and have run into a
I have just recently started carrying out unit testing for my software written in
I have just started to learn Haskell out of interest. I follow learnyouahaskell.com .
I have a small query.I just started out with the SWT programming and learnt

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.