Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

function- boolean

 
farahin samsudin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi this is my code,i'm try to solve question 8 but its contain error at line 153. the error show the boolean cannot be dereferenced.



and this my class for my programme



the program should called the data from the txt.file so here the txt file.
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi farahin,

Welcome to CodeRanch!

I haven't gone through all your code, but there seems some issue on line 153.

Hint: what is return type of method getStudCollege?

I hope this will help.
 
farahin samsudin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Anayonkar,
it supposed to be boolean right?
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
farahin samsudin wrote:hi Anayonkar,
it supposed to be boolean right?

Well, I'm not sure why that method is boolean (how a college can be a boolean btw?), but the main issue is, boolean is a primitive (and not a class), and hence, you can't invoke euqals (or any) method on it (besides, you are invoking that method with String argument, but that is another issue).
 
farahin samsudin
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohhh, okay i've got it. thanks Anayonkar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic