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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:51:58+00:00 2026-06-02T13:51:58+00:00

I have a class Node ,then I created my tree node in my main

  • 0

I have a class Node,then I created my tree node in my main
like this:

static void Main(string[] args)
{
  Node IProot = new Node("ANY-IP");           
}

I want to have access to this Node all the times even when I will go through another function(setting IProot global) for example I want to have

public static alarm generalize(alarm one,alarm two)
{       
   //some code
}

instead of

public static alarm generalize(alarm one,alarm two,Node IProot)
{       
  //some code
}

if this is totally wrong what should I do?

Because I don’t have access to IProot, I have to get it as an input to my function so that I can code with IProot,but it is much better for me to not get it as an input.
I tried static Node where I defined IProot in the main, but that resulted in an error. I also tried static class Node for my class, again no result.

  • 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-02T13:51:59+00:00Added an answer on June 2, 2026 at 1:51 pm

    Try this:

    static Node IProot;
    
    static void Main(string[] args)
    {
        IProot = new Node("ANY-IP");
    }
    

    This instantiates the IProot object in your application’s Main method, and will allow that instance of the object to be accessible in the methods in your class.

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

Sidebar

Related Questions

I have this very simple C++ class: class Tree { public: Node *head; };
I have a binary tree class that is created with a root node and
I have this class: public class Source extends Node { protected DistributionSampler delay ;
I have this code for BinaryTree creation and traversal class Node { Integer data;
Im having a problem with python.. I have a binary tree node type: class
I have a tree like structure created out of models using ForeignKey linkages. As
I have created a BinaryTreeNode<T> class and then creating Add(T data) method for BinaryTree<T>
I have a Java class, Node as follows : class Node { public ArrayList<Node>
To keep things simple, lets say I have a Node class, each node has
I have a class being used in node.js, and I want to pass various

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.