⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 questions.html

📁 一些JAVA的小程序
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>Questions and Exercises: Object-Oriented Concepts</title><script language="JavaScript"><!-- hidefunction openWin(term) {  url="../../../information/glossary.html#" + term;  myWin= window.open(url, "Glossary",              "width=400,height=150,scrollbars=yes,status=no,toolbar=no,menubar=no");  myWin.focus();}//--></script><STYLE type="text/css"><!--.FigureCaption   { margin-left: 1in; margin-right: 1in; font-family: Arial, Helvetica, sans-serif; font-size: smaller; text-align: justify }--></STYLE> </head><body BGCOLOR="#ffffff" LINK="#000099"><B><FONT SIZE="-1">The Java</font><sup><font size="-2">TM</font></sup> <font size="-1">Tutorial</FONT></B><br><table width="550" summary="layout"><tr><td align="left" valign="middle"><a href="../practical.html" target="_top"><img src="../../../images/PreviousArrow.gif" width="26" height="26" align="middle" border="0" alt="Previous Page"></a><a href="../../TOC.html#concepts" target="_top"><img src="../../../images/TOCIcon.gif" width="26" height="26" align="middle" border="0" alt="Lesson Contents"></a><a href="../../nutsandbolts/index.html" target="_top"><img src="../../../images/NextArrow.gif" width="26" height="26" align="middle" border="0" alt="Next Page"></a></td><td align="center" valign="middle"><font size="-1"><a href="../../../index.html" target="_top">Start of Tutorial</a>&gt;<a href="../../index.html" target="_top">Start of Trail</a>&gt;<a href="../index.html" target="_top">Start of Lesson</a></font></td><td align="right" valign="middle"><font size="-1"><a href="../../../search.html" target="_top">Search</a><br><a href="http://developer.sun.com/contact/tutorial_feedback.jsp">Feedback Form</a></font></td></tr></table><img src="../../../images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" ALT=""><br><font size="-1"><b>Trail</b>: Learning the Java Language<br><b>Lesson</b>: Object-Oriented Programming Concepts</font><h2>Questions and Exercises: Object-Oriented Concepts</h2><blockquote></blockquote><h3>Questions</h3><blockquote>Use the API documentation for the Java 2 Platform to answer the following questions.<ol><li> The <code>ClickMe</code> component uses <code>Color.BLACK</code>     when setting up its border.     What other colors can you get by name like this?<li> How would you create a <code>Color</code>     object to represent purple?     (<em>Hint:</em> Purple is made up of equal parts of red and blue.)     <li> Which <code>Graphics</code> method would you use to draw a filled square?<li> Which <code>Graphics</code> method would you use to draw text?</ol></blockquote><h3>Exercises</h3><blockquote>Use what you've learned from the preceding questionsto make the following modifications to the<code>ClickMe</code> component.<blockquote><hr><strong>Note:</strong>&nbsp;The point of these exercises is to encourage you to read codeand to use the API documentation.We haven't yet given you any detailed informationabout how to write code,but you might be surprised at how much you can do.<hr></blockquote><ol><li> Modify <code>ClickMe</code> to draw a red square     instead of a green spot.<br><li> Modify <code>ClickMe</code> to display your name in purple     instead of a green spot.<br></ol><p>Remember, to compile and use the <code>ClickMe</code> component,you need the files<a target="_blank" href="../ex5/ClickMe.java"><font color="#bb000f"><code><code>ClickMe.java</code></code></font></a><a target="_blank" href="../ex5/ClickMe.java"><img src="../../../images/sourceIcon.gif" width=11 height=11 border=0 align="MIDDLE" alt=" (in a .java source file)"></a>,<a target="_blank" href="../ex5/ClickMeApp.java"><font color="#bb000f"><code><code>ClickMeApp.java</code></code></font></a><a target="_blank" href="../ex5/ClickMeApp.java"><img src="../../../images/sourceIcon.gif" width=11 height=11 border=0 align="MIDDLE" alt=" (in a .java source file)"></a>, and <a target="_blank" href="../ex5/Spot.java"><font color="#bb000f"><code><code>Spot.java</code></code></font></a><a target="_blank" href="../ex5/Spot.java"><img src="../../../images/sourceIcon.gif" width=11 height=11 border=0 align="MIDDLE" alt=" (in a .java source file)"></a>.You can run the program using the command<code>java ClickMeApp</code>.</blockquote><a target="_top" href="answers.html">Check your answers.</a><a target="_top" href="answers.html"><img src="../../../images/tutorialIcon.gif" width=11 height=11 border=0 align="MIDDLE" alt=" (in the Learning the Java Language trail)"></a><blockquote></blockquote><img src="../../../images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" ALT=""><br><table width="550" summary="layout"><tr><td align="left" valign="middle"><a href="../practical.html" target="_top"><img src="../../../images/PreviousArrow.gif" width="26" height="26" align="middle" border="0" alt="Previous Page"></a><a href="../../TOC.html#concepts" target="_top"><img src="../../../images/TOCIcon.gif" width="26" height="26" align="middle" border="0" alt="Lesson Contents"></a><a href="../../nutsandbolts/index.html" target="_top"><img src="../../../images/NextArrow.gif" width="26" height="26" align="middle" border="0" alt="Next Page"></a></td><td align="center" valign="middle"><font size="-1"><a href="../../../index.html" target="_top">Start of Tutorial</a>&gt;<a href="../../index.html" target="_top">Start of Trail</a>&gt;<a href="../index.html" target="_top">Start of Lesson</a></font></td><td align="right" valign="middle"><font size="-1"><a href="../../../search.html" target="_top">Search</a><br><a href="http://developer.sun.com/contact/tutorial_feedback.jsp">Feedback Form</a></font></td></tr></table><p><font size="-1"><a href="../../../information/copyright.html">Copyright</a>1995-2005 Sun Microsystems, Inc.  All rights reserved.</font></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -