Solved

Number of parameters

Posted on 2008-10-09
3
192 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will learn how to implement Singleton Design Pattern in Java.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now