css display , visibility property vs android visibility

p.ex1 {display: none;}
p.ex2 {display: inline;}
p.ex3 {display: block;}
p.ex4 {display: inline-block;}

h2.a {
 visibility: visible;
}

h2.b {
 visibility: hidden;
}

Visible

XML file: android:visibility=“visible”

Java code: view.setVisibility(View.VISIBLE);

invisible

XML file: android:visibility=“invisible”

Java code: view.setVisibility(View.INVISIBLE);

Hiding (GONE)

XML file: android: visibility = “go”

Java code: view.setVisibility(View.GONE);