Jump to content

Java constructor with attributes help....

Go to solution Solved by R4STABAN,

You need a small T.

 

true & false are the possible Boolean values.

Not sure if anyone will be able to help me, but;

 

I have to learn some Java for uni, and we have a small assignment, it's just a social network for the sake of it. Basically we need to create a program that creates and displays the information of 2 users, plus some other stuff that I haven't done yet. The basic format for each is, as you can see from the class:

 

User: Sam

City: Sydney

Status: Online

Friends: 2

New stories available: 3

 

User: Elle

City: Melbourne

Status: Online

Friends: 2

New stories available: 3

 

The Fasebook class compiles fine and I had it working before but not displaying any attributes, however below is what I get for the program (also yes, we need to use the BlueJ IDE...):

post-2523-0-27450200-1372590865_thumb.pn

Laptop Lenovo Thinkpad X220 - CPU: i5 2420m - RAM: 8gb - SSD: Samsung 830 - IPS screen Peripherals Monitor: Dell U2713HM - KB: Ducky shine w/PBT (MX Blue) - Mouse: Corsair M60

Audio Beyerdynamic DT990pro headphones - Audioengine D1 DAC/AMP - Swan D1080-IV speakers

Link to comment
https://linustechtips.com/topic/31172-java-constructor-with-attributes-help/
Share on other sites

Link to post
Share on other sites

ah, right, should be reading more  :P however:

post-2523-0-07517600-1372591624.png

Laptop Lenovo Thinkpad X220 - CPU: i5 2420m - RAM: 8gb - SSD: Samsung 830 - IPS screen Peripherals Monitor: Dell U2713HM - KB: Ducky shine w/PBT (MX Blue) - Mouse: Corsair M60

Audio Beyerdynamic DT990pro headphones - Audioengine D1 DAC/AMP - Swan D1080-IV speakers

Link to post
Share on other sites

You need a small T.

 

true & false are the possible Boolean values.

 

Thank you! I still have to do all this stuff, of which we haven't been taught how to do yet. Kind of need to figure it out on my own... Just trying to get basic functionality first.

post-2523-0-73540500-1372592032.png

Laptop Lenovo Thinkpad X220 - CPU: i5 2420m - RAM: 8gb - SSD: Samsung 830 - IPS screen Peripherals Monitor: Dell U2713HM - KB: Ducky shine w/PBT (MX Blue) - Mouse: Corsair M60

Audio Beyerdynamic DT990pro headphones - Audioengine D1 DAC/AMP - Swan D1080-IV speakers

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×