A basking shrak is an ectotherm which means that their body temperature depends on their environment.Basking sharks swim close to the surface of the water and appear to be sunning themselves like lizards (also ectotherms) but are actually feeding on plankton... Why ,ight a land-dwelling creature like a lizard need to sun itself, while a water dwelling creature like a shark does not? this is very confusing to me. Someone please explain...Thanks.

It's possible that they are gaining heat from the sun while they feed on plankton, but I'm not 100% sure. Where do these sharks live? If they live in warm water areas they may be able to use the warm water to regulate their temperature, rather than lizards who lose heat to the surrounding air constantly due to evaporation.

There are 3 different kinds of ectothems. Some stay under sunlight ,like lizards(they are called heliotherm) ; some use muscle power to obtain the needed heat, like some Lepidoptera(family Sphingidae)( they are called shimiothem), and some use some physical(like evoporation) and chemical (speeding up-slowing down meatbolism) methods to maintain body temperature(they are called cyclotherm), when the temperature of the the envionment rises below 30C or falls under 10C.
Most of the reptiles and insects are heliotherm.
This is not written in my book but my guess is that shark is shimiothem, means uses muscle power to obtain the needed heat.

PS: The terms cyclothem, heliotherm and shimiotherm are my translations. They may not be the same in english.

It matters not how strait the gate
How charged with punishment the scroll
I am the Master of my fate
I am the Captain of my soul.

It's quite possible that basking sharks are shimiotherms because they never stop moving. (no sharks do) They need to constantly keep in motion otherwise they will sink (and ultimately die due to lack of oxygen) because they don't contain float bladders like fish do. While the basking shark is in motion for this reason, it may be simultaneously regulating its body temperature.