Home » JAVA Programming » Java Basic » Question
  1. How to assign values to variable using property?
    1. @Environment(“${my.property}”)
      private String prop;
    2. @Env(“${my.property}”)
      private String prop;
    3. @Value(“${my.property}”)
      private String prop;
    4. @Property(“${my.property}”)
      private String prop;
    5. None of these
Correct Option: C

@Value are used to inject the properties and assign them to variables.



Your comments will be displayed only after manual approval.