Solved

Number of parameters

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 84
Problem to App 4 99
null output 3 36
jboss 7.1 start up error 1 42
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

808 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