skip to main | skip to sidebar

this.getClass()

Sunday, September 23, 2012

Classes and Methods

  class Dog() {
    def bark1 = println("bark");

    def bark2 = {
      println("bark");
    }

    def bark3: Unit = {
      println("bark");
    }

    def bark4() = println("bark");
  }

  val dog = new Dog();
  dog.bark1;
  dog.bark2;
  dog.bark3;
  dog.bark4;
  dog.bark4();
Posted by tkr at 11:03 AM
Labels: Scala

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Labels

  • Scala
  • DSL
  • AspectJ
  • Groovy
  • Java

Blog Archive

  • ▼  2012 (25)
    • ▼  September (25)
      • Structural Typing Zur Hilfe
      • Structural Food Typing
      • Pattern Matching Unpack
      • Pattern Matching Simplify
      • Pattern Matching Case Classes
      • Pattern Matching Cal
      • Pattern Matching Beverages
      • Pattern Matching Basics
      • Duck Typing
      • Case Classes
      • Closures
      • Schedule
      • Meassure Execution Time
      • Filter and Map
      • Brainteaser
      • Twice
      • Group By Task
      • Call with Retry
      • Syntactic Sugar
      • Functions, Params and Return
      • GroupBy, ForEach and Case
      • Reduce, Min, MinBy, Sum and MkString
      • Type Inference and Generics
      • Classes and Methods
      • Vals, Vars, Attributes and Contructors
  • ►  2008 (9)
    • ►  December (1)
    • ►  May (1)
    • ►  March (3)
    • ►  February (4)