1,HTML source code£º <html> <head> <title>How to use Point</title> </head> <body> <script src="jsjava.js"></script> <script> function out(str){ document.write(str+"<br>"); } var p=new Point(30,50); out(p); p.setLocation(50,80); out(p); p.translate(30,20); out(p); </script> </body> </html> 2,The display:

{x=30,y=50} {x=50,y=80} {x=80,y=100}