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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:33:41+00:00 2026-06-08T16:33:41+00:00

I cannot seem to get this to work without the compiler yelling at me

  • 0

I cannot seem to get this to work without the compiler yelling at me for being… stupid. But I have a class with another nested static class inside of it. I am trying to access it but I get a syntax error saying:

unexpected token ::

I am trying to call the class as follows:

myLibrary\myClass::nestedClass::myFunction()

The first set to ‘::’ work just fine but the second pair are causing an error. Any idea of how I approach this? A lot of my libraries are written this way and I would very much appreciate if someone could help me!

  • 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-08T16:33:43+00:00Added an answer on June 8, 2026 at 4:33 pm

    There is actually a solution to this. Silly me! In order to get the nested class out of the class, its really simple. Look at how you can get a DataTable class out of the System .NET class:

      System\Data\DataTable
    

    the same can be done with your library. For the code I have posted above, simply do:

      myLibrary\myClass\nestedClass::myFunction()
    

    I replaced the first :: with a \ This way the compiler knows what I am looking for! Thanks for the suggestions, all of them would work wonderfully, in fact maybe are a little better code practice wise!

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

Sidebar

Related Questions

I have this design which I cannot seem to get right, I would like
This is a very old problem, but I cannot seem to get my head
I need a function, but cannot seem to get it quite right, I have
I cannot seem to get this to work. Any thoughts? <html xmlns=http://www.w3.org/1999/xhtml> <head> <meta
I cannot seem to get this date picker working at all. I know it
I recently started with PHP Object Oriented and I cannot seem to get this
I cannot seem to get the quotes around this statement right. No matter what
So obviously I am doing something wrong, but I just cannot seem to get
I'm having trouble with my DatabaseConnection class. I cannot seem to get $dbUser or
I've been trying to get this to work. It's basically a way to have

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.