Let the total number of marbles in the bag be 'x'.
Given that exactly 25% of the total marbles are black,
Also, given that there are total 8 marbles in the bag,
Then the number of black marbles will be obtained by substituting x=8,
Thus, there are 2 black marbles in the bag.