Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

BlueJ - program problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI, I am from Slovakia, sorry for my english I´m beginner
OK so I coding this program - It´s Eshop(SVK-Obchod) and Aplication(svk-Aplikacia) but i have problem with code and i don´t know what i doing...

THIS IS MY Eshop (OBCHOD) main class:






AND THIS IS MY APLLICATION (Aplikacia)





Where I have bugs ? THANK YOU
 
lowercase baba
Posts: 13075
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch. I have added code tags to your post, which formats it and makes it easier to read. Next time, just highlight your java then click that little "code" button above where you enter the post, and it will insert them for you.

Next...What makes you think you have bugs? It's generally easier for folk to help you if you give us all the info - why you think there are bugs, what the program does (or doesn't do), what you expect it to do, or what the compiler error is that you get when you compile it.

The easier you make it for someone to help you, the more likely you will get that help.
 
Marshal
Posts: 76486
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome again

I don't know what the bugs are, but I can see errors.
You are using == false. Don't. Never.
Not
if (b == false) ...
but
if (!b) ...
Not
if (b == true) ...
but
if (b) ...
You have some fields which you are not initialising in your constructor. You have given the fields public access; they should have private access. I also think you have too many fields. You also have a field which mysteriously appears in line 74. Keep all your fields together, so you will know what they are. That last field is a reference type, and that can be particularly dangerous if you forget to initialise it.
 
He's my best friend. Not yours. Mine. You can have this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic