http://www.fsf.org/bulletin/2007/fall/antifeatures/
This article talks about antifeatures. Antifeatures, as defined in this article, is functionality that a technology developer will charge users to not include. One such example is with Windows NT Server versus Windows NT Workstation. Essentially, they are both the same program. However, Windows NT Workstation had many of those features disabled during installation when certain flags went up that the installation was for Workstation and not Server. In some cases, users can pay to have these features turned off. In other cases, they cannot.
Wednesday, May 21, 2008
Sunday, May 18, 2008
Put answers on blog or Google document before next class (Monday). Questions on page 74.
Exercise R2.1.Explain the difference between an object and an object reference.
An object is a value of a class type that consists of a state and related behavior while an object reference is a variable that contains the memory location of the object and allows access to that object.
Exercise R2.2.Explain the difference between an object and an object variable.
An object is a value of a class type while an object variable is a symbol that identifies a storage location that can hold different values.
Exercise R2.3.Explain the difference between an object and a class.
An object is a value of a class type while a class is a programmer-defined data type.
Exercise R2.4.Give the Java code for constructing an object of class Rectangle, and for declaring an object variable of class Rectangle.
Rectangle rectAngL = new Rectangle(0, 0, 15, 15)
Rectangle rectAngL refers to a new object variable that is being declared while new Rectangle(0, 0, 25, 25) refers to the object that is being constructed that is to be assigned to the variable.
Exercise R2.5.Explain the difference between the = symbol in Java and in mathematics.
The = symbol in Java is used to assign values and is always going to take the value to the right and assign it to the variable on the left, whereas in mathematics it is simply used to state that the expression on the left and the expression on the right are of equal value.
Exercise R2.6.Uninitialized variables can be a serious problem. Should you always initialize every int or double variable with zero? Explain the advantages and disadvantages of such a strategy.
Unless you are guaranteed to use user-inputted data for the variable, you should always initialize the variable to zero. The advantage would be that you are assured of where the value is explicitly stated and you have a point in the code in which you can trace back in the event of an error.
Exercise R2.7.Give Java code to construct the following objects:
(a)A rectangle with center (100, 100) and all side lengths equal to 50
Rectangle rectAngL = new Rectangle(100, 100, 50, 50);
(b)A string “Hello, Dave!”
Create objects, not object variables
System.out.println("Hello,Dave!");
Exercise R2.1.Explain the difference between an object and an object reference.
An object is a value of a class type that consists of a state and related behavior while an object reference is a variable that contains the memory location of the object and allows access to that object.
Exercise R2.2.Explain the difference between an object and an object variable.
An object is a value of a class type while an object variable is a symbol that identifies a storage location that can hold different values.
Exercise R2.3.Explain the difference between an object and a class.
An object is a value of a class type while a class is a programmer-defined data type.
Exercise R2.4.Give the Java code for constructing an object of class Rectangle, and for declaring an object variable of class Rectangle.
Rectangle rectAngL = new Rectangle(0, 0, 15, 15)
Rectangle rectAngL refers to a new object variable that is being declared while new Rectangle(0, 0, 25, 25) refers to the object that is being constructed that is to be assigned to the variable.
Exercise R2.5.Explain the difference between the = symbol in Java and in mathematics.
The = symbol in Java is used to assign values and is always going to take the value to the right and assign it to the variable on the left, whereas in mathematics it is simply used to state that the expression on the left and the expression on the right are of equal value.
Exercise R2.6.Uninitialized variables can be a serious problem. Should you always initialize every int or double variable with zero? Explain the advantages and disadvantages of such a strategy.
Unless you are guaranteed to use user-inputted data for the variable, you should always initialize the variable to zero. The advantage would be that you are assured of where the value is explicitly stated and you have a point in the code in which you can trace back in the event of an error.
Exercise R2.7.Give Java code to construct the following objects:
(a)A rectangle with center (100, 100) and all side lengths equal to 50
Rectangle rectAngL = new Rectangle(100, 100, 50, 50);
(b)A string “Hello, Dave!”
Create objects, not object variables
System.out.println("Hello,Dave!");
Wednesday, May 14, 2008
Reaction to this quote
"Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." - Donald Knuth
What I take from this quote is that the author believes the focus should be to teach others about programming so that they have a better understanding of what computers do.
What I take from this quote is that the author believes the focus should be to teach others about programming so that they have a better understanding of what computers do.
Think about all the attributes and methods a plant nursery would need
OO ... Object oriented.
Most important attributes and methods a plant nursery would have.
Class
PlantNursery
Attributes:(String, int, or double)
Greenhouse - String
Soil (bags) - int
Plant Food (Quantity) - int
Gardening Tools - int
Cost - double
Seeds - int
Plants (name, type) - String
Plants (quantity) - int
Pesticide - int
Fertilizer - int
Methods:
Display the number of plants and their names
Display the feeding each plant receives
Calculate the growth rate
Calculate number of plants sold
Calculate profit based on plants sold versus cost of plant maintenance
Most important attributes and methods a plant nursery would have.
Class
PlantNursery
Attributes:(String, int, or double)
Greenhouse - String
Soil (bags) - int
Plant Food (Quantity) - int
Gardening Tools - int
Cost - double
Seeds - int
Plants (name, type) - String
Plants (quantity) - int
Pesticide - int
Fertilizer - int
Methods:
Display the number of plants and their names
Display the feeding each plant receives
Calculate the growth rate
Calculate number of plants sold
Calculate profit based on plants sold versus cost of plant maintenance
Monday, May 12, 2008
First Blog
First blog at davidmisigoy.blogspot.com. What I hope to get out of this course is a working knowledge of java as in my line of work I have come across several instances of java and I would like to have some familiarity with it.
Subscribe to:
Comments (Atom)