jagomart
digital resources
picture1_Education Ppt 72428 | 23 Hipster Static


 170x       Filetype PPT       File size 2.37 MB       Source: courses.cs.washington.edu


File: Education Ppt 72428 | 23 Hipster Static
critter exercise snake method behavior constructo public snake r eat never eats fight always forfeits getcolor black getmove 1 e 1 s 2 w 1 s 3 e 1 s ...

icon picture PPT Filetype Power Point PPT | Posted on 31 Aug 2022 | 3 years ago
Partial capture of text on file.
               Critter exercise: Snake
           Method                                  Behavior
          constructo public Snake()
          r
          eat              Never eats
          fight            always forfeits
          getColor         black
          getMove          1 E, 1 S; 2 W, 1 S; 3 E, 1 S; 4 W, 1 S; 5 E, ...
          toString         "S"
                                                                                             7
       Copyright 2010 by Pearson Education
                                                                                            10
       Copyright 2010 by Pearson Education
           Critter exercise: Hipster
    All hipsters want to get to the bar with the cheapest PBR
    That bar is at a randomly-generated board location
        (On the 60-by-50 world)
    They go north then east until they reach the bar
                                                                                            11
       Copyright 2010 by Pearson Education
                         Static members
    static: Part of a class, rather than part of an object.
        Object classes can have static methods and fields.
        Not copied into each object; shared by all objects of that class.
                                                  class
                            state:
                            private static int staticFieldA
                            private static String staticFieldB
                            behavior:
                            public static void someStaticMethodC()
                            public static void someStaticMethodD()
                 object #1                    object #2                   object #3
          state:                       state:                      state:
          int field2                   int field1                  int field1
          double field2                double field2               double field2
          behavior:                    behavior:                   behavior:
          public void                  public void                 public void 
          method3()                    method3()                   method3()
          public int method4()         public int method4()        public int method4()
          public void                  public void                 public void 
          method5()                    method5()                   method5()                13
       Copyright 2010 by Pearson Education
The words contained in this file might help you see if this file matches what you are looking for:

...Critter exercise snake method behavior constructo public r eat never eats fight always forfeits getcolor black getmove e s w tostring copyright by pearson education hipster all hipsters want to get the bar with cheapest pbr that is at a randomly generated board location on world they go north then east until reach static members part of class rather than an object classes can have methods and fields not copied into each shared objects state private int staticfielda string staticfieldb void somestaticmethodc somestaticmethodd field double...

no reviews yet
Please Login to review.