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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:28:50+00:00 2026-06-15T05:28:50+00:00

I just got an assignment back, which was marked down due to the following

  • 0

I just got an assignment back, which was marked down due to the following method definition:

static String[] getDayData (int day) {

I was told:

Your functions should always have the definer public/private/protected in them.

Despite the fact that I disagree with the function part in Java, It clearly states here that:

The only required elements of a method declaration are the method’s return type, name, a pair of parentheses, (), and a body between braces, {}.

So who has any thoughts on this? Should I always include a modifier in the method’s definition or not?

  • 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-15T05:28:51+00:00Added an answer on June 15, 2026 at 5:28 am

    That statement, taken at face value, is definitely wrong. If what you wanted to declare is a package-private method, then this is the only way to do it. That declaration cannot possibly be added an access modifier without having its meaning changed.

    What exactly your teacher has in mind with his marking criteria is a separate issue, but from my own teaching experience I cannot agree with that comment. Teaching Java 101 absolutely does include all method access levels.

    On a side note, I can also not agree with his arbitrary use of “function” instead of the official term “method”. This is just bad teaching in my book, and whether the underlying cause is ignorance of Java or just misguided didactics is not to be discerned from the information we have. And… did he really use the term “definer”? This term doesn’t even exist—whether in Java or elsewhere.

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

Sidebar

Related Questions

Basically I just got some results back for an assignment and my results were
I just got an assignment.It is to design a java socket server which accepts
I just got another assignment for web design. And I was curios how to
I just got a homework assignment, and it's just creating a linear search algorithm
We just got our first major Perl CGI assignment in my CS class. Our
I've got the following problem with an array assignment... I've got a global float
I'm just learning about C and got an assignment where we have to translate
I am new to mac os x programming and just got an assignment to
I just got a seg fault in overloading the assignment operator for a class
I just got a project in my Computer Science class. We got the assignment

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.