Java: Decrease value of primitive from getter or use setter? Hello StackOverflow Community! I hope you're having a nice day.  I'm asking myself if I can just decrease an int obtained from a getXYZ() method of another class (the int should also be modified in the other class) or if I must use a setter?  for example:  Class: Monster  public int getHealth() {     return health; }   Class: Bullet  applyDamage(target);  private void applyDamage(Monster target) {      target.getHealth() - 1; // OR     target.setHealth(4);  }
Is Java "pass-by-reference" or "pass-by-value"? I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
Why Re-throw Exceptions? I've seen the following code many times:  try {     ... // some code } catch (Exception ex) {     ... // Do something     throw new CustomException(ex);      // or     // throw;      // or     // throw ex; }   Can you please explain the purpose of re-throwing an exception? Is it following a pattern/best practice in exception handling? (I've read somewhere that it's called "Caller Inform" pattern?) Why do we not use the definite article in "Where can I find the room 401?" Last week in college, a student [with a thick South Asian accent] asked me:     "Excuse me, where can I find the room 401?".   I realized that to my native English ears, the word "the" sounded non-native. This had me realize that we sometimes use no article.  I am learning French; in French, we seem to always use some kind of article before nouns. It surprised me, at that moment, to realize that English doesn't always do the same! (That, and using the definite article in "the room 401" seems to make sense if I think about when definite articles are used).  Is there a grammatical name or concept for this "no article" aspect of our language? Are there any websites that can explain this to me? Windows Media Player 12 shows wrong cover art when playing Scaling problem with fillbetween in pgfplots What is the behaviour of \fontsize if baselineskip is below a certain value? during my optimization process I found something spurious I cannot explain to myself and which I would like to understand. So with \fontsize you set the fontsize and the baselineskip. However the behaviour of the second paramater is a bit unclear to me, because if you reduce it too much, at a certain point the baselineskip gets bigger again. Let me show you my example: \documentclass[landscape]{article} \usepackage[margin=1cm]{geometry} \usepackage{lipsum,multicol}  \begin{document} \begin{multicols}{4}     \fontsize{10}{11}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{10}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{9}\selectfont     \lipsum[1]     \columnbreak          \fontsize{10}{8}\selectfont     \lipsum[1]     \columnbreak \end{multicols} \end{document}  If you compile this, your result will be looking like this:  Now from the first to the third column it seems logic, that the baselineskip is reduced and hence less space is needed vertically to typeset. But with the third column, even though the baselineskip is reduced even further, it needs more vertical space overall. It is strange however, that for example from line 11 to 12 (starting with tus and lum), the spacing seems to be narrower than in column 3, while in a lot of line the spacing is bigger. Changing the baselineskip to lower values down to 0 does not modify the vertical alignment further. What is the purpose of this behaviour and is it intended? I cannot see a benefit of this and I am a bit confused. I'm having difficulty with exercise 1.43 of Lang's Algebra. The question states     Let $H$ be a subgroup of a finite abelian group $G$. Show that $G$ has a subgroup that is isomorphic to $G/H$.   Thinking about this for a bit, the only reasonable approach I could think of was to construct some surjective homomorphism $\phi\colon G\to K$ for $K\leq G$, and $\ker\phi=H$, and then just use the isomorphism theorems to get the result.  After a while of trying, I've failed to come up with a good map, since $H$ seems so arbitrary. I'm curious, how can one construct the desired homomorphism? This is just the approach I thought of, if there's a better one, I wouldn't mind seeing that either/instead. Thank you. Do the laws of physics evolve? Proper submodules of Noetherian modules are intersections of indecomposable modules If $M$ is Noetherian, any submodule $N \neq M$ can be written as a finite intersection of intersection-indecomposable ones.   I just don't know how to begin with the proof of this proposition.   Very kind of you for reading or answering. Maximum log level exceeded in Developer Console Recently I have regularly been getting the error message below when opening the Developer Console:     The Developer Console didn't set the DEVELOPER_LOG trace flag on your   user. Having an active trace flag triggers debug logging. You have 316   MB of the maximum 250 MB of debug logs. Before you can edit trace   flags, delete some debug logs.   It happens in sandbox and scratch orgs. Haven't tried in production.  This only started happening recently. It goes away after clearing the logs but comes back after a few test runs.  Also: the Debug->Clear->Log Panel action is not working for me -- the logs stay put. I can remove them using the Query Editor as described , but it's pretty tedious.  Two questions:   Does anyone know a way to prevent the logs from exceeding the max level? Perhaps by having old logs cleared out automatically? Is there a known issue with the Clear Log Panel action? I am using Chrome btw.   Thanks! I flagged a question, , as "low quality" but a moderator declined it. I thought that the post was a low quality one and would like to know why the moderator did not.  Hopefully shedding light on this matter will avail me of the knowledge to be a better flagger in future.  My logic was that mysql-fetch-row is not supposed to return an array of results. If it does than its name would be mysql-fetch-rows.  What's your take on the situation? Installed Ubuntu alongside Windows 8, and W8 won't boot anymore Problems when adding a fillable PDF form if the page is rotated What is the status icon that looks like a house? How do I deal with a bored or distracted player bringing down the group? My group have been playing various D&amp;D style games for a few years,  I have one player however that often will drift off and start playing on his phone  and several times has actually fallen asleep (with his character having to be "nudged" along by his fellow players).  He insists he's "just tired" and "isn't bored" — and besides, he keeps insisting we all get together for D&amp;D and wants to play.  Unfortunately we're all pretty busy, so if I'm to get the group together at all it's usually late on a Sunday. After talking to the player he insists it's not the game, or the story, he just happens to be tired. But, it's the same excuse every week, and the odd times we've played at different times or situations, the falling asleep has happened.  How do I cope with:   The morale destroying (for me) idea of your players falling asleep through a campaign and story you've put lots of work into. The general tone of the room when this player loses interest. (Occasionally a couple of others zone out into Facebook when they're not "active" because the players have split up / gone unconscious).   Given that it's an "all or nothing" situation with the group (there are only 3 players and they won't play unless all 3 are around), how do I best deal with it? Font characters displayed as squares in Ubuntu 18.04 How should I use quotation marks in sections of multiline dialogue? If I want to introduce a “pause” between lines of dialogue from the same person by inserting a spacing line, how should I use the quotation marks correctly to indicate continued dialogue? I really don’t want to write it in a gossipy “he said, she said” way!  I have noticed that closing quotations aren’t always placed on the end of a line.  What are the rules? Sum of binomial coefficients with index divisible by 4 I am trying to obtain a closed form expression for  $\sum {n \choose 4k}$  I am trying to use the binomial expansion of $(1 + i)^n$ and $(1 - i)^n$. $$(1 + i)^n + (1 - i)^n = 2\left(\sum {n \choose 4k} -\sum {n \choose 4k + 2}\right)$$ Stuck at this now. I can't come up with a way to simplify the second term on RHS. Any help would be appreciated. How to make all polygons into triangles "DataBinding: 'index+NewsItem' does not contain a property with the name 'Link'", but property exists (Not a Typo) Short story with competitors complaining to government about a new very popular synthetic food