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

The Archive Base Latest Questions

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

I guess my question is would static class example1{ function example1_function(){}; } and class

  • 0

I guess my question is would

static class example1{
    function example1_function(){};     
}

and

class example2{
    static function example2_function(){};
}

lead to the same result, which is both example1->example1_function() and example2->example2_function() have the same callabilty. Would both be defined as static and usable as such?

  • 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-22T01:27:32+00:00Added an answer on May 22, 2026 at 1:27 am

    You cannot declare a class as a static class, as stated by other members here, but there is a method where you can stop the class from becoming an object, you can use the abstract keyword to specify the object should not be instantiated using the new keyword, this is good for inheritance etc.

    abstract class Something
    {
    }
    

    Doing new Something would trigger an error stating you cannot instantiate the class, you can then declare your static methods like so:

    abstract class Something
    {
        public static function Else()
        {
        }
    }
    

    You still have to declare you methods as static, this is just the way it is.

    and then you can use like so:

    Something::Else();
    

    Hope this clears up a few thing’s

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

Sidebar

Related Questions

I guess the question title sums it up. Is there a time when it
Okay guess this question looks a lot like: What is the best way to
I guess this question will sound familiar, but I am yet another programmer baffled
I have a HashMap (although I guess this question applies to other collections) of
Simple question I guess, I want to use PHP to write an update to
I guess the real question is: If I don't care about dirty reads, will
This is very basic magento question i guess. I want to first get all
A little stuck here. I have a simple question I guess. Given the following
My guess is that this question will fall under the category of duh, but,
I guess this is a simple question. I need to do something like this:

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.