473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Valid Call in Java

Hi All,

I am new learner for Java.

My doubt is:

public static void mystery (int list [], int size)

parameter: int list [], int size

declaration: int [] alpha = new int[50]


Q: Produce a valid call to the method mtstery.
My answer: mystery(alpha,50); (isn't correct?)

BTW what is the valid call mean?

Thanks and appreciate for the assist.

Brgs,
ChiaSien
Aug 14 '07 #1
2 2009
JosAH
11,448 Expert 8TB
Hi All,

I am new learner for Java.

My doubt is:

public static void mystery (int list [], int size)

parameter: int list [], int size

declaration: int [] alpha = new int[50]


Q: Produce a valid call to the method mtstery.
My answer: mystery(alpha,50); (isn't correct?)

BTW what is the valid call mean?

Thanks and appreciate for the assist.

Brgs,
ChiaSien
Well, syntactically speaking even mystery(null, -42) is quite a valid method call.
Also mystery(new int[42], 54) would be fine. There is no way to enforce that the
second parameter reflects the length of the frst parameter. The caller can do
whatever it wants. The mystery() method should check the validity of its parameters
itself in order to make it a 'valid' call.

Personally I'd had made it a mystery(int[] anArray) method; that int size thing
seems redundant.

kind regards,

Jos
Aug 14 '07 #2
Hi All,

I am new learner for Java.

My doubt is:

public static void mystery (int list [], int size)

parameter: int list [], int size

declaration: int [] alpha = new int[50]


Q: Produce a valid call to the method mtstery.
My answer: mystery(alpha,50); (isn't correct?)

BTW what is the valid call mean?

Thanks and appreciate for the assist.

Brgs,
ChiaSien
Looks like a trick question to me, unless you have omitted some code from your example. Otherwise it is not valid Java, since every function must belong to a class.
Aug 14 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Shyamal Prasad | last post by:
Hi, Is there anyway to write JSP files as valid HTML of any sort. What I want to know is if JSP files are some sort of valid XML with a DTD that will check contents. Perhaps JSP files are valid...
6
by: Eugene A | last post by:
Hello. In this call from a Java prog to a Oracle SP I am trying to pass along some varchars and a cursor, but apperently the syntax of the call to the stor proc is incorrect. What am I doing...
1
by: John Sidney-Woollett | last post by:
Is it possible to call a Postgres stored function (as if it were a procedure), using a PreparedStatement which will receive no return value, instead of having to use a CallableStatement and ignore...
4
by: Jean-Marc Blaise | last post by:
Dear all, I have simulated the windows MULTI application with a java program calling the SQLTP1DL proc referenced as DB2DARI application, on Linux Intel or ZLinux. If the proc is NOT FENCED,...
5
by: member | last post by:
Hi, I'm looking for tools which can valid an XML document with and XSD schema. I'm using Eclipse and I don't know how to do that and if I can ? Thanks, Laurent Duretz
1
by: Keith | last post by:
I am trying to create my first stored procedure using ISeries Navigator. I receive the following error. Token SQL was not valid. Valid tokens: C CL COBOL COBOLLE FORTRAN PLI RPG RPGLE JAVA. ...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
11
by: BigZero | last post by:
Hello, can i call Java method.That is java code from php,here what i m looking for i have class called DB in this class all the DB related things ,like DB connection DB insert,DB read etc...
5
madzman23
by: madzman23 | last post by:
Hi guyz, I kinda new here and I dont know if there is post that similar to my question, because I really needed immediately I am posting my question. Can anyone here help me how to call a Java...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.