public class Traingle {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
char c=' ';
for (int i=0; i<4; i++)
{
for (int k=0; k<6-i; k++)
{
System.out.print(" ");
}
for (int j=0; j<i*2+1; j++)
{
System.out.print("*");
}
System.out.println(c);
}
}
}
Using base in a derived class invokes the base class's corresponding method. For example, something like: class Shape{ public void print(){printf("Generic shape"); ... } class Triangle:Shape{ public void print(){printf("Triangle"); ... } int main() { Triangle x; x.print(); // Should print "Triangle" x.base.print(); // Should print "Generic shape" return 0; }
Sort of. Triangle is one of the shape that may tessellate(fit tightly). But one may argue that triangle is not a square (for sure), nor a tile (yet I think it may be) to a tessellate.
triangle for small parts and an arch for a large part.
I believe a declared type is the type used when first declaring a variable. And the actual type is the type that the variable is actually assigned, which could be the declared type or any subtype of that type. So given GeometricObject shape = new Triangle(); GeometricObject is the declared type and Triangle is the actual type. To demonstrate this more clearly the following statements are all correct. GeometricObject shape; // shape declared to be a GeometricObject shape = new Triangle(); // actual type assigned = Triangle shape = new Square(); // now shape refers to a Square object This is the basis of polymorphism. It allows you to write methods which have for parameters more general types but are able to handle subtypes differently. This makes your code more general and reusable.
When referring to size, something can be very small or very big. When referring to the shape, an item can be round, square, or even a triangle.
there is not one because a equilateral triangle is one triangle so the ansew is equilateral triangle
An equilateral triangle is a regular shape because it has 3 equal sides.
It is a Triangle.
a square. or an equilateral triangle
Only if it's an equilateral triangle.
You are an equilateral triangle
Equilateral triangle
Equilateral Triangle
equilateral triangle
a larger equilateral triangle
A equilateral triangle and a normal triangle.
Equilateral triangle.