I have a shed in my backyard and I have installed a sink on the outside to clean up with. I have run a cold water line to the sink, but would like to attach a "heated" line to the hot water side. I have found a few projects on YOUTUBE about making a solar water heater and they used "black tubing", but never said what kind of black tubing. I know CPVC is used inside of building for hot and cold water applications, but will it withstand direct sunlight. Also know it will be painted black to help heat the water. Thank you for any advice in advance.
Sunlight resistance is not a problem if you're going to be painting it anyway. The real problem is temperature. You're not clear as to how you intend to design the system, but, unless you take specific measures to prevent overheating (e.g. by having a pump that turns on and flushes pipes periodically), pipes can get very hot. Solar heaters are traditionally copper, which can handle boiling water just fine. On the other hand, CPVC is only rated up to about 200 F. Maximum temperature varies depending on pressure and pipe dimensions, but, generally speaking, at 200 F, CPVC piping is barely strong enough to withstand normal water-main pressure. ("Hot water" inside your house is rarely hotter than 140 F.) Other plastics are as bad or even worse (e.g. ABS and PVC are both rated for lower temps than CPVC and PEX). The link in the other answer suggests that PEX might handle 230 F, but it depends on your system (I don't see any pipe dimensions there).
Black tubing is ABS. ABS is used for waste lines and not potable water supply lines. PEX is best and easiest to use for potable water supply lines. Copper is best to use for exposed solar lines because the metal will absorb the solar heat quickly and efficiently, but can be costly.
Here's a link on PEX used for solar tubing... http://www.builditsolar.com/Experimental/PEXCollector/PEXCollector.htm
Of all the normal plumbing materials, by far copper has the best heat exchange characteristics.
I would spend the money on the copper tubing for the collector itself. It will pay for itself with the difference in the amount of heat collected.
After that, you can pipe to and from the collector with PEX or CPVC if you like. The supply and return lines will have to be thoroughly insulated. Here is where PEX will actually help by having a lower heat coefficient and not lose as much heat going to and from the exchanger.
If the unit overheats from lack of water flow, the superheated water can blow the PEX lines. Check Mother Earth News, and Home Power for articles on DIY solar water heaters. Lots of great reading there.
Sounds like a fun project. Good,luck!