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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:33:20+00:00 2026-05-16T23:33:20+00:00

I have a Java assessment that gets marked by a robot. Whenever I upload

  • 0

I have a Java assessment that gets marked by a robot. Whenever I upload my assignment it shows a screen like this.

A good object-oriented design places each method into the most appropriate
class. The most appropriate class for a method should be the same class as
the data fields that that method needs to access. If you don't place a method
into the right class, then this will most likely increase the amount of
communication that is required between your classes.

The score below measures the amount of communication between your classes. A
lower score is better.

19 method invocations between classes
7 arguments passed between classes
15 results returned between classes

Amount of communication = invocations + 2*inputs + 2*outputs = 63

Now what exactly does “method invocations between classes”, “arguments passed between classes” and “results returned between classes” mean?

  • 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-16T23:33:21+00:00Added an answer on May 16, 2026 at 11:33 pm

    Method invocations between classes

    As your class contains their own methods if you want to call the method from another class you have to use an instance of this class.

    For example :

    class A{
        public void methodA(){
        }
    }
    class B{
        public void methodB(){
        }
    }
    

    If I want to call methodA() from the class B I must use this:

    public void methodB(){
        A a = new A();
        a.methodA(); // method invocation between classes
    }
    

    Argument passed between classes

    This time methodA() will need an argument, and B as a field which could be used as argument.

    class A{
        public void methodA(int argument){
        }
    }
    class B{
        private int fieldB = 42;
        public void methodB(){
        }
    }
    

    To call methodA() from B you will pass an argument from a class to another.

    public void methodB(){
        A a= new A();
        a.methodA(fieldB); //Argument passed between classes
    }
    

    Results returned between classes

    And now methodA() returns a result this is the code.

    class A{
        public int methodA(){
            return 42;
        }
    }
    class B{
        private int fieldB;
        public void methodB(){
        }
    }
    

    To use/handle the returned value of the methodA() from the class B you’ll have to do this:

    public void methodB(){
        A a= new A();
        fieldB = a.methodA(); //Result returned between classes
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning to code in Java. I have this assessment that I need to
I have Java code like that: //first moment of the today Calendar cal =
I have Java project that I formerly debugged using Sysdeo Launcher. Now I'd like
I have mapped several java classes like Customer, Assessment, Rating, ... to a database
I have java code which looks something like this: for(int i=0;i<codeWord.length;i++) { codeWord[i] =
I have Java classes like this: public class Config { public Config1 getConfigOpt1(); public
I have java sdk 1.7. I've always used django/python for web development, this will
I have Java Map (out of Strings and Ints) objects that I want to
I have Java Desktop application that displays some information in a JTable that contains
I have Java app that takes data from external app. Incoming JSONs are in

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.