Question: ```
#include<stdio.h>
main()
{
  printf("%c\n",1-3+2["nexus"]);
}

```

The result is **v**. How does it turn out?  

What does the indentation (square ones) do?

Answer: 
There's also one other good [source](https://androidlearnersite.wordpress.com/2017/02/27/fragment-lifecycle-during-fragment-transaction/) that you can read through. 

I think, the important point is the difference of the transaction you performed on Fragment B. If it's **add**, then no lifecycle methods are called on **Fragment A**, if it's **replace**, you will get some calls on those methods.
You can find a nice `Fragment` lifecycle diagram in the android docs [here](http://developer.android.com/guide/components/fragments.html). So yes, if the fragment is brought to the foreground from the backstack `onCreateView()`, `onActivityCreated()`, `onStart()` and `onResume()` are called.