Solved

Number of parameters

Posted on 2008-10-09
3
197 Views
Last Modified: 2013-11-23
Hi

As you can see the code, if the question asks you to write down the numbers of parameters and return type.

The answer would be index, 1 parameter?

and what about the return type? getStudent?

Thanks.
public Student getStudent(int index)

Open in new window

0
Comment
Question by:bt1942
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
manuel_m earned 500 total points
ID: 22676189
Correct. It would be 1 parameter of type int and the parameter name index.

The return type is an object of type Student.

getStudent is a method that you call.
0
 

Author Closing Comment

by:bt1942
ID: 31504561
Thanks for the help!
0
 
LVL 6

Expert Comment

by:manuel_m
ID: 22676236
The method is declared "public". That means that all other classes, regardless of the package they belong to, can access the method.

Student: This is a class that seems to be in your project as a class file or in a jar-file that you have downloaded or something else.

getStudent(int index): this is the method name. get-methods (should) always declare a method that gives you an object or a value back, such as an int or a String value.
The method has a parameter value of type int. Because I don't know what this method does I just guess that the method searches in an array or Collection for the object at the specified index given by the parameter. Maybe it is a select statement to a table in a database.
Anyway it returns an object of type Student that should be found with the help of the parameter index.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question