The Artima Developer Community
Sponsored Link

Java Answers Forum
calling a method

2 replies on 1 page. Most recent reply: Jan 10, 2003 5:50 AM by Ugo Posada

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Jonathan

Posts: 1
Nickname: rodeoburnz
Registered: Jan, 2003

calling a method Posted: Jan 9, 2003 7:09 PM
Reply to this message Reply
Advertisement
how do you call a method like this:
public void aMethod(int x[],int y)


it doesn't work if I call it like this"
object.aMethod(1,1)


someone please help. thank you.


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: calling a method Posted: Jan 10, 2003 2:21 AM
Reply to this message Reply
> how do you call a method like this:
>
> public void aMethod(int x[],int y)
> 

>
> it doesn't work if I call it like this"
>
> object.aMethod(1,1)
> 

>
> someone please help. thank you.

it does not work because the arguments expected are : an integer array and an integer. You are passing integer for both the arguments.

Ugo Posada

Posts: 37
Nickname: binaryx
Registered: Dec, 2002

Re: calling a method Posted: Jan 10, 2003 5:50 AM
Reply to this message Reply
This is what Singh M. means ->

int[] a = {1,2,3,4};
int b = 5;
 
aMethod(a, b); 

Flat View: This topic has 2 replies on 1 page
Topic: Sound: sequencing wav/au files Previous Topic   Next Topic Topic: how to enter the values in JTable in runtime

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use