Solved

Number of parameters

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
printf performancy 11 105
java imports not found 4 71
Setup GlassFish 4 56
ArrayList Adding/settign data 3 38
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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

752 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