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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:25:37+00:00 2026-06-13T06:25:37+00:00

During my interview, interviewer asked me Can we create class without name ? Since,

  • 0

During my interview, interviewer asked me

Can we create class without name ?

Since, I was not sure, if it is really possible to create a class without name. So, I said No.

Later, I tried Googling and found, others are also looking for the answer of the same question, but I didn’t found clear answer.

I will appreciate, if anyone clearly explain about this class. I mean, what that class technically known as and how can we instantiate this class ?

  • 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-13T06:25:38+00:00Added an answer on June 13, 2026 at 6:25 am

    Yes, it’s called an anonymous class/struct.

    In C++:

    class {
    } x;
    

    x is an object of the type, and you can’t create any more, because, well, how would you, given that the class doesn’t have a name and all….

    how would one call constructor and destructors

    You don’t. In both Java and C++ constructors and destructors hold the same name as the class (they’re not PHP – __construct or whatever), and the missing name kind of gets in the way.

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

Sidebar

Related Questions

In a recent interview, I was asked a really strange question. The interviewer asked
During an interview I was asked if there can be some object that will
Recently I was asked this during a job interview. I was honest and said
A friend of mine was asked, during a job interview, to write a program
I was asked this question recently during my job interview, and I couldn't answer
During the project building, i received an error: Could not load JDBC driver class
I was asked the following question during phone interview I had: Given the following
During .Net interview, I was asked what is function augmentation. Never heard it and
I was asked this question during phone interview. Given two strings find the minimal
This is a programming question asked during a written test for an interview. You

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.