This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes function- boolean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "function- boolean" Watch "function- boolean" New topic
Author

function- boolean

farahin samsudin
Greenhorn

Joined: Apr 07, 2013
Posts: 3
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

Joined: Dec 08, 2010
Posts: 1505
    
    5

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.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
farahin samsudin
Greenhorn

Joined: Apr 07, 2013
Posts: 3
hi Anayonkar,
it supposed to be boolean right?
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1505
    
    5

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

Joined: Apr 07, 2013
Posts: 3
ohhh, okay i've got it. thanks Anayonkar
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: function- boolean