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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:17:49+00:00 2026-06-06T02:17:49+00:00

Ok I feel really dumb asking this but I seem to be missing something

  • 0

Ok I feel really dumb asking this but I seem to be missing something really simple here. I have the following code in a class in my service layer –

public Items getItems(String category, float amount, String color,
            String type)

The code reads from a database and returns the results – I plan on placing it in a jframe. Nice and simple. But no matter how I call it from the jframe I get errors in eclipse that the code is wrong – either that their are illegal modifiers or such. So obviously I am calling it completely wrong, so my stupid question is how do you call that method into a jframe?

For example – if I try to call it this way:

public Items getItems();  

I get told that getItems is an illegal parameter.
If I call this.. Items getItems(); I am told its undefined

  • 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-06T02:17:50+00:00Added an answer on June 6, 2026 at 2:17 am

    Since you put some code up there, you are invoking the method wrong; what you have is not valid Java.

    First you need to get an instance of your service.

    MyService service = new MyServiceImpl();

    I’m assuming your service is defined as an interface (MyService), with a class that implements the interface (MyServiceImpl).

    then you invoke the method on the instance

    Items items = service.getItems(stuff);

    what you have

    public Items getItems();

    is some sort of hybrid between a method definition and a method invocation.

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

Sidebar

Related Questions

I feel really dumb for asking this question, but here it goes. I have
I feel really stupid for asking a question like this, but I cannot seem
I feel really stupid for asking this but I have been thrashing for over
I feel really silly asking this, but it is completely blowing my mind why
I suspect I am going to feel really stupid after posting this but here
I feel like this might be really simple but I'm just not getting it
I feel like there's a simple solution to this, but I'm not really sure
I feel really silly for asking this, but what am I doing wrong with
ok... so I feel really stupid asking this question.. but just wondering about the
I feel really silly for asking this , but how do I place buttons

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.