• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about Q2-1 in Gupta OCA Java 7 book - Chapter 2 - Working with Java data types

 
Ted North
Ranch Hand
Posts: 201
1
Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,

I hope everyone is doing well. I recommend watching lots of MST3K for lots of uncontrollable lols.

Anyways apparently this is an incorrect statement:
Once assigned, the value of a primitive can't be modified.

This is also an incorrect statement:
A value can't be assigned to a primitive variable


The first one seems like it should be correct because primitive variables can be incremented and decremented with ++ and -- operators etc.
The second one seems like it should be correct because a primitive variable like int x is designed to hold different values like 1 or 1000 or 100_000 or any thing in its range.

What am I missing?

Really Confused,

Ted
 
Roel De Nijs
Sheriff
Posts: 10442
136
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The questions asks to select all incorrect statements. So the answers b, c & d are the incorrect statements and should be selected to answer this question correctly.
 
Ted North
Ranch Hand
Posts: 201
1
Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roel De Nijs wrote:The questions asks to select all incorrect statements. So the answers b, c & d are the incorrect statements and should be selected to answer this question correctly.


Wow, I just checked the book and I think your statement is correct. For some reason I had problems understanding the basic instructions. I seemed to select one blatant wrong answer and left the other blatant wrong answers alone as if the objective of the question changed half way through me answering it to selecting only correct statements.

I was tired when I wrote this post last night and took the practice exam. Hopefully, I will think with more brain cells when I take the OCAJ7. Thank-you Roel De Nijs for helping me understand where I went wrong.

Losing my brains,

Ted
 
Roel De Nijs
Sheriff
Posts: 10442
136
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the question correctly is sometimes already 50% of answering it correctly

On the exam you'll have a little bit of help, because each question mentions the number of correct answers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic