Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tta2001_fourth;
- public class TTA2001_Fourth {
- public static void main(String[] args) {
- Animal animal= new Animal();
- animal.isHuman();
- Animal animal2 = new Animal(2);
- animal2.isHuman();
- }
- }
- class Animal{
- int tail = -1;
- Animal(){
- }
- Animal(int tail){
- this.tail= tail;
- }
- void isHuman()
- {
- if(tail!=-1){
- System.out.println("NOt Humman");
- }
- else{
- System.out.println("Human");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement