score:1
i'm not an expert but @inject annotation is related to a dependency injection framework like guice. guice will initialize a, b and c if it can. imho the problem with most of this frameworks is that they can throw wiring exceptions at runtime (containers are a very dark world :p). try to use, at least if you are learning, the first approach. it will help you to focus on learning language basics and don't fight with a di framework and compiler will help you a lot. i recommend you a di framework for a large projects.
Source: stackoverflow.com
Related Query
- Difference between class parametrs and injected parameters
- Scala: what is the real difference between fields in a class and parameters in the constructor
- Difference between type inference of method and class type parameters in pattern matching
- Difference between object and class in Scala
- What is the difference between Scala's case class and class?
- Difference between Abstract Class and Trait
- What's the difference between multiple parameters lists and multiple parameters per list in Scala?
- Difference between case class and case object?
- What is the difference between a class and a type in Scala (and Java)?
- What's the difference between a class with a companion object and a class and object with the same name?
- Difference between using sealed trait and sealed abstract class as a base class
- Difference between conversion with implicit function and implicit class in Scala
- Scala case class copy-method difference between 2.9 and 2.10
- Difference between home made extractor and case class extractor
- Difference between a class snippet and an object snippet
- What's the difference between a companion object and a singleton class in Scala (Guice)
- What is the difference between dependency injected router and static router in ScalaRouting of Play Framework?
- Difference between scala concurrent and non concurrent class under parallelsim
- What is the specific difference between a sealed trait and an abstract sealed class in scala?
- What is the difference between "with" and "new" for context parameters in scala?
- Uses of the type class and difference between type class and type trait
- What is the difference between object A extends B and class A extends B and later new B
- Practical Difference Between Type and Class in Scala
- Difference between Class and Class.type in Scala
- In Scala, what is the difference between fun _ and fun as parameters
- what is the difference between passing parameters () => T and just T
- Difference between instantiating something from the class and from the companion object
- What are the differences difference between `lazy` class variables and `lazy` local variables in a closure?
- What Is The Difference Between Functions Definitions And Class Definitions
- Difference between case class with parentheses and without
More Query from same tag
- How is a match word omitted in Scala?
- java.lang.OutOfMemoryError: PermGen space in play framework
- Creating a List of Range
- Simplest way to change multiple elements in a Seq in Scala
- scala - Can I overload curried methods?
- Scala drop elements from a list
- dynamic dispatch in c from scala
- How to pattern match large Scala case classes?
- Scala macro expansion of class with companion: type not found
- Can scala accept any derivation of a tuple as an argument list?
- Can't compile example from book Advanced Scala with Cats
- Override toString behavior for Option[_] in scala
- Sorted generic sequence
- Abstracting implicit val of case class
- Type class pattern for unary type constructors
- how does databricks 'date_trunc' function run in the back end?
- Implementing binary operations on generic class in scala
- Explain Kinesis Shard Iterator - AWS Java SDK
- How to convert list to queue in scala
- Socket issues in simple Scala TCP server
- Aux Pattern for higher-kinded types
- Is there any trick to use macros in the same file they are defined?
- Exception: 'writeStream' can be called only on streaming Dataset/DataFrame
- Strange error when using processing library from maven central in a sbt project
- Running a method after the constructor of any derived class
- Json Writes in Play 2.1.1
- Scala Iterating Tuple Map
- What are the annotees of a scala macro annotation? Or how many times is macro applied
- Java or Scala RFC5987
- ScalaTest Scalactic - Custom Double Equality with tolerance including Double.NaN case