Вы находитесь на странице: 1из 1
Objectives: eu Vocabulary: Identify objects, methods, and classes. (© Objects are entities in your program that you manipulate by calling methods. © Amethod is a sequence of instructions that accesses the data of an object. © Aclass describes a set of objects with the same behavior. Write variable declarations and assignments. Use comments to add explanations for humans who read your code. The compiler ignores ‘© Avariable is a storage location with a name. © When deciaring a variable, you usually specify an initial value. © When declaring a variable, you also specify the type of its values. ‘© Use the int type for numbers that cannot have a fractional part. ‘© Use the double type for floating-point numbers. © Numbers can be combined by arithmetic operators such as +. -, and *. © By convention, variable names should start with a lowercase letter.\ comments. © Use the assignment operator (=) to change the value of a variable. ° All variable must be initialized before you access them. ‘The assignment operator = does not denote mathematical equality. Recognize arguments and return values of methods. ‘© The public interface of a class specifies what you can do with its objects. The hidden. implementation describes how these actions are carried out. © Anargument is a value that is supplied in a method call. © The return value of a method is a result that the method has computed. ructors to construct new objects. ° ° ° ° method. ‘© Use the new operator, followed by a class name and arguments, to construct new objects. Write program that display frame windows. To show a frame, construct a JFrame object, set its size, and make it visible. In order to display a drawing in a frame, declare a class that extends the JComponent class. Place drawing instruction inside the paintComponent method. That method is called whenever the component needs to be repainted. Use a cast to recover the Graphics2D object from the Graphics argument of the paintComponent Use the Java API for drawing simple figures. ‘© The Ellipse2D.Double and Line2D.Double classes describe graphical shapes. ‘0 The drawstring method draws a string, starting at ‘© When you set a new color in the; basepoint. graphics context, itis used for subsequent drawing operations. character, string with another string, etc.

Вам также может понравиться