Java Class and Object

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leonardsores
    New Member
    • Dec 2019
    • 1

    Java Class and Object

    Hi i am currently Java student and i am a bit confused, i have to create class for Cell Phone, so far so good i created class and i need to show info of three cellphone i created, it is good to, i created it and even create a public void showInfo() in order to show the info of each object now the next step i need to do is this:

    Display only the modified attributes of the three objects. All outputs showing only the price of a cell phone (i.e. not the rest of the attributes) must be formatted.

    I just don't understand the question i feel like i missed a bit in the class maybe because i didn't hear it (i have hearing disabilities) I tried to find anything that might help me to clarifiy in the lecture note and nada maybe I understood wrong but the way i understand is i need to show only modified value like for example: i create a cellphone with brand named Samsung, year 2014, price of $500 and i change the price to let say $350, it only show $350... Did I understand it right? if so I have no clue how to do it :( just need a direction to look or a hint
    Last edited by Niheel; Feb 17 '20, 01:42 AM.
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 655

    #2
    Display only the modified attributes of the three objects. All outputs showing only the price of a cell phone (i.e. not the rest of the attributes) must be formatted.
    Use conditionals to check if the specific attribute is modified.

    Comment

    • Ishan Shah
      New Member
      • Jan 2020
      • 47

      #3
      If you are storing cellphone data (brand_name and price) in the array list then you can use the list.set() method by an object index number and new value which you want to be set.

      Comment

      Working...