-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTest59.java
More file actions
35 lines (32 loc) · 830 Bytes
/
Copy pathTest59.java
File metadata and controls
35 lines (32 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class BirdsThree //class
{
int age;
int wings;
String color;
double weight;
void fly() //method
{
System.out.println("they fly to fulfill natural activities");
}
void sing() //methods
{
System.out.println("Bird sing");
}
}
public class Test59{
public static void main(String args[])
{
BirdsThree Parrot=new BirdsThree(); //Object Parrot instantiated from the class Bird
Parrot.age=5;
Parrot.wings=3;
Parrot.weight=4.5;
Parrot.color="Green";
System.out.println("Age of Parrot="+Parrot.age);
System.out.println("wings of Parrot="+Parrot.wings);
System.out.println("Weight of Parrot="+Parrot.weight);
System.out.println("Color of Parrot="+Parrot.color);
Parrot.fly();
Parrot.sing();
System.out.println("---------------------------");
}
}