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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:08:18+00:00 2026-05-13T08:08:18+00:00

Hey guys, got a problem with a question. Question : Write a declaration for

  • 0

Hey guys, got a problem with a question.

Question : Write a declaration for a variable people that could be used to refer to an Array of objects of type Person

My answer:

public people[];
people = new Person [100];

But I am getting an error saying it is wrong. What am I doing wrong?

PS. I also tried public people[] = new Person [100]

The error that I am receiving is this:

Main.java:5: <identifier> expected
public people[];
               ^

Main.java:6: <identifier> expected
people = new Person [100];
       ^

2 errors

The output should have been: If it wasn’t correct it won’t have compiled

This is what was actually produced: Exception in thread “main” java.lang.NoClassDefFoundError: Main`

  • 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-13T08:08:18+00:00Added an answer on May 13, 2026 at 8:08 am
    public Person[] people = new Person[100];
    
    • public is an access modifier;
    • Person[] is an array of type Person;
    • people is the name of the variable that holds a reference to the aforementioned array;
    • new Person[100] allocates a new array of type Person that is capable of storing up to 100 Persons.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys got a quick question here, how do i set up TweetStream after
Hey guys I got a weird issue.. I have a datalist that's only loaded
Hey guys, I've got what I imagine is a simple question, but for some
Hey Guys, I've got the following float array... public static float camObjCoord[] = new
Hey guys, i got a problem, with whome i'll likely going to spend the
Hey guys! Got a problem when I connect with a embedded device via bluetooth.
Hey guys I've got a text file that a script creates (specifically dmidecode >
Hey Guys, I've got a thumbnail on a webpage that when clicked, plays a
Hey guys i got a problem which is doing my head in, and was
Hey Guys. I have got a problem on using the jquery auto-complete plugin.my problem

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.