Skip to main content



      Home
Home » Newcomers » Newcomers » Java import statement hints
Java import statement hints [message #1759764] Tue, 18 April 2017 05:35 Go to next message
Eclipse UserFriend
I'm learning Java and am importing a package to try out the Calendar class.
import java.util.Calendar.*;


The problem is quite often the template proposal window that comes up seems to be inconsistent and a class that I know exists is sometimes offered and sometimes not in the proposal window. Please see attached images and you will see what I mean.

Why is this and how can I correct it?

index.php/fa/29072/0/
index.php/fa/29073/0/
  • Attachment: Capture1.PNG
    (Size: 35.25KB, Downloaded 1880 times)
  • Attachment: Capture0.PNG
    (Size: 44.24KB, Downloaded 1450 times)

[Updated on: Tue, 18 April 2017 05:36] by Moderator

Re: Java import statement hints [message #1759771 is a reply to message #1759764] Tue, 18 April 2017 07:18 Go to previous messageGo to next message
Eclipse UserFriend
Yes, it seems often it wants to propose package names, and once it starts proposing package names, even typing a "." will then show only package names and not class names. After you type a "." you can hit Ctrl-space a bunch of times to cycle through the proposal types, and then it shows class. In general though, I never ever try to complete imports in this way. I just use a class in context and then complete it there, which then generated the appropriate import. So I'd suggest you get out of the habit of ever typing an import statement and trying to complete it. Just start typing the name of the class at the point where you want to use it, and complete it there...
Re: Java import statement hints [message #1759782 is a reply to message #1759771] Tue, 18 April 2017 09:23 Go to previous message
Eclipse UserFriend
Yes that seems to work and saves me having to write import statements. Thanks for the suggestion Smile
Previous Topic:Permissions problems in my workspace (self-caused, self-resolved)
Next Topic:The nested constructor "new A(new B(x))"
Goto Forum:
  


Current Time: Mon Oct 27 08:55:57 EDT 2025

Powered by FUDForum. Page generated in 0.33067 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top