cannot apply...wrong type or wrong operator?help please!
Selecta Zhangy
Greenhorn
Joined: Nov 15, 2006
Posts: 16
posted
0
im trying to do"type 1 then shows the calendar" program, but it keep jumping error!:"setcalendar(int) in calendar cannot be applied to()"!!!
anyone explain it to me and tell me how to correct it please! thanks!
Remko Strating
Ranch Hand
Joined: Dec 28, 2006
Posts: 893
posted
0
You're refering to the setcalendar(int year) method without supplying a integer value. If this is not needed you could overload this method where there is no integer value needed.
thanks, but im still confusing, more help(especially the way how to solve it) please... [ March 21, 2007: Message edited by: Selecta Zhangy ]
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
posted
0
What it means is that the method expects you to send an int.
Selecta Zhangy
Greenhorn
Joined: Nov 15, 2006
Posts: 16
posted
0
Originally posted by Keith Lynn: What it means is that the method expects you to send an int.
thanks, yes i know. but how do i make the calendar an int???the calendar class is holding different variables , how can itself be an int???its so complex...
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
posted
0
You're not trying to make a Calendar an int. The method you are trying to call expects you to send an int. The name of the parameter suggests that you should send an int indicating the year.
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
9
posted
0
You don't need to make the calendar an int. In this code you are calling the setcalendar() method. However, the setcalendar method is declared as which means you need to pass an integer value which represents a year. So, as an example, to pass this year as an argument, you change your code to