Definition of denseness The set of  rationals in $(0,1)$ are dense. 
I am confused by its definition.  
Some of my friends says that $A$ is dense in $X$ if closure of $A$ is $X$
and  some say
That $A$ and $B$ are subset of reals and $A$ is subset of $B$. Then $A$ is dense in $B$ if $B$ is contained in closure of $A$.
Please anyone explain  with examples 
 A: Let $X$ be a topological space (e.g. any subset of $\mathbb{R}$).  The usual definition of a subset $A \subseteq X$ being dense in $X$ is that the closure of $A$ in $X$ is $X$.
The thing is that "closure" is a relative term: it depends on what space you are thinking about.  If you have $A \subseteq B \subseteq \mathbb{R}$, the closure of $A$ in $B$ is in general not the same thing as the closure of $A$ in $\mathbb{R}$.
For example, if $B = (0,1)$, and $A = (0,\frac{1}{2})$, the closure of $A$ in $B$ is $(0,\frac{1}{2}]$, while the closure of $A$ in $\mathbb{R}$ is $[0,\frac{1}{2}]$.
Here is how the two different notions of closure are related: the closure of $A$ in $B$ is equal to $\overline{A} \cap B$, where $\overline{A}$ is the closure of $A$ in $\mathbb{R}$.
Therefore, to say that $A$ is dense in $B$, i.e. the closure of $A$ in $B$ is equal to $B$, is to say that $B = \overline{A} \cap B$.  But this last equation is the same thing as saying that $B \subseteq \overline{A}$.
A: The general definition: if $X$ is a space, $D \subseteq X$ is dense iff $\operatorname{cl}_X(D) = X$, where $\operatorname{cl}_X$ denotes the closure in $X$. This is the first definition that you name.
If $B \subseteq X$ has the subspace topology (so we consider $B$ as topological space in its own right, in the subspace topology $\mathcal{T}_B = \{O \cap B: O \in \mathcal{T}_X\}$), then for any subset $A$ of $B$, the definition of subspace topology implies the standard fact relating closures in $B$ to the ones in $X$:
$$\operatorname{cl}_B(A) = \operatorname{cl}_X(A) \cap B$$
So $A$ is dense in the space $B$ means (using the general definition for the space $B$) that $\operatorname{cl}_B(A) = B$ so 
$\operatorname{cl}_X(A) \cap B = B$, which means exactly that $B \subseteq \operatorname{cl}_X(A)$. This is exactly the second definition you mention. 
So that one is the general definition applied $B$ as a space its own right. 
The above applies to all spaces (not just subsets of the reals). Your original example $A = \mathbb{Q} \cap (0,1)$, all rationals in $(0,1)$ is dense in $(0,1)$ (or $[0,1]$ as well) as $\operatorname{cl}_{\mathbb{R}}(A) = [0,1]$. 
