This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 1502
    
    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: 1502
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: function- boolean
 
Similar Threads
getting java.lang.NoSuchMethodError: main error! thanks =)
Array returning last value entered
Problem using XMLEncoder and XMLDecoder
hashmap
Sorting array of Objects in Java using comparable