Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6980899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:05:11+00:00 2026-05-27T18:05:11+00:00

In Guice’s documentation, the chapter about Untargetted Bindings presents this example: bind(AnotherConcreteClass.class).in(Singleton.class); What does

  • 0

In Guice’s documentation, the chapter about Untargetted Bindings presents this example:

bind(AnotherConcreteClass.class).in(Singleton.class);

What does the in() do? The doc doesn’t mention what it is for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:05:11+00:00Added an answer on May 27, 2026 at 6:05 pm

    It’s just the scope I think. It also accept the Scopes enum – either Singleton or NO_SCOPE.

    A scope is a level of visibility that instances provided by Guice may
    have. By default, an instance created by the Injector has no scope,
    meaning it has no state from the framework’s perspective — the
    Injector creates it, injects it once into the class that required it,
    and then immediately forgets it. Associating a scope with a particular
    binding allows the created instance to be “remembered” and possibly
    used again for other injections.

    http://google-guice.googlecode.com/svn/tags/3.0/javadoc/com/google/inject/Scopes.html#SINGLETON

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the Guice documentation, there is an Untargetted Binding example as: bind(MyConcreteClass.class) .annotatedWith(Names.named(foo)) .to(MyConcreteClass.class);
I met a problem when trying @Singleton of Guice: import com.google.inject.Singleton; @Singleton public class
I create guice servlet like this: public class GuiceApplicationServlet extends AbstractApplicationServlet { protected Provider<Application>
I'm trying to use Google Guice with the @Inject and @Singleton properties as follows:
Does anybody know of a way to use Guice to inject dependencies into the
In Guile 1.6.*, the function scm_istring2number(char *str,int strlen,int radix) does the work. However, this
Guice Singletons are weird for me First I thought that IService ser = Guice.createInjector().getInstance(IService.class);
With reference to Guice's custom injections article, its TypeListener performs a check for InjectLogger.class
The SVN version of Guice supports JSR-330 annotations (JSR-330 Integration - This documents an
How does Guice's TypeLiteral overcome the Java generic types erasure procedure? It works wonders

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.