This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes cannot apply...wrong type or wrong operator?help please! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot apply...wrong type or wrong operator?help please!" Watch "cannot apply...wrong type or wrong operator?help please!" New topic
Author

cannot apply...wrong type or wrong operator?help please!

Selecta Zhangy
Greenhorn

Joined: Nov 15, 2006
Posts: 16



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
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.


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Selecta Zhangy
Greenhorn

Joined: Nov 15, 2006
Posts: 16
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: 2367
What it means is that the method expects you to send an int.
Selecta Zhangy
Greenhorn

Joined: Nov 15, 2006
Posts: 16
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: 2367
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: 3453
    
  12
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


Joanne
Selecta Zhangy
Greenhorn

Joined: Nov 15, 2006
Posts: 16
problem sovled!!!thanks everyone!!!
 
Don't get me started about those stupid light bulbs.
 
subject: cannot apply...wrong type or wrong operator?help please!