The weight of an object can be calculated with the following formula:

Where:
w = weight
m = mass
g = gravitation acceleration
For the first object we have:
![\begin{gathered} w_1=m_1\cdot g \\ g=(w_1)/(m_1)=\frac{9N}{3\operatorname{kg}}=3\frac{N}{\operatorname{kg}} \end{gathered}]()
In the last equation we found the value of g. Now, we the value of g we can calculate the mass of the second object.
For the second object:
![\begin{gathered} w_2=m_2\cdot g \\ m_2=(w_2)/(g)=\frac{24N}{3\frac{N}{\operatorname{kg}}}=8\operatorname{kg} \end{gathered}]()
Answer: the mass of the second object is 8 kg.