Josh is older than Fred. Josh notices that if he switches the two digits of his age (an integer), he gets Fred’s age. Moreover, the difference between the squares of their ages is a square of an integer. How old are Josh and Fred?
1. Let Josh's age be represented as \(10a + b\), where \(a\) and \(b\) are the digits of his age. Similarly, let Fred's age be represented as \(10b + a\).

2. The difference between the squares of their ages is given by:
   \[
   (10a + b)^2 - (10b + a)^2
   \]

3. Expanding both squares, we get:
   \[
   (10a + b)^2 = 100a^2 + 20ab + b^2
   \]
   \[
   (10b + a)^2 = 100b^2 + 20ab + a^2
   \]

4. Subtracting these two expressions, we have:
   \[
   (100a^2 + 20ab + b^2) - (100b^2 + 20ab + a^2) = 100a^2 + b^2 - 100b^2 - a^2
   \]
   \[
   = 99a^2 - 99b^2
   \]
   \[
   = 99(a^2 - b^2)
   \]

5. We are given that the difference between the squares of their ages is a square of an integer. Let this integer be \(k\). Therefore:
   \[
   99(a^2 - b^2) = k^2
   \]

6. Since \(99 = 3^2 \times 11\), we can write:
   \[
   a^2 - b^2 = (a - b)(a + b)
   \]
   \[
   99(a^2 - b^2) = 99(a - b)(a + b) = k^2
   \]

7. For \(99(a - b)(a + b)\) to be a perfect square, \((a - b)(a + b)\) must be of the form \(11m^2\) where \(m\) is an integer. Given \(0 \leq a, b \leq 9\), we have \(a + b \leq 18\).

8. The only possible values for \(a + b\) that satisfy \(a + b = 11\) and \(a - b = n^2\) (where \(n\) is an integer) are:
   \[
   a + b = 11
   \]
   \[
   a - b = 1^2 = 1
   \]

9. Solving these two equations:
   \[
   a + b = 11
   \]
   \[
   a - b = 1
   \]

10. Adding these two equations, we get:
    \[
    2a = 12 \implies a = 6
    \]
    \[
    b = 11 - a = 11 - 6 = 5
    \]

11. Therefore, Josh's age is \(10a + b = 10 \times 6 + 5 = 65\) and Fred's age is \(10b + a = 10 \times 5 + 6 = 56\).

12. To verify, we check the difference between the squares of their ages:
    \[
    65^2 - 56^2 = (65 - 56)(65 + 56) = 9 \times 121 = 1089 = 33^2
    \]

Thus, the conditions are satisfied.

The final answer is \( \boxed{65 \text{ and } 56} \)