If you’re thinking ahead about your knee health, both are great options to build strength and range of motion in the knees.
Using either of them will benefit your overall knee health now and into the future.
However, if you have damaged knees, suffer from prior injury, osteoarthritis or other degenerative conditions, a bike is probably the better option.
An elliptical should only be used by those who can stand for reasonable periods of time, as it requires your knees to support your full body weight.
In contrast, biking takes the strain off your knees and requires less weight bearing in general.