Results 1 to 7 of 7
  1. #1
    jmohandos304 is offline Member
    Join Date
    Apr 2014
    Posts
    67
    Rep Power
    0

    Default Intellisense: instanceof not appearing

    The instanceof operator does not appear automatically(IntelliSense) when I press Ctrl+space. Instead some if condition involving instanceof is shown. What is special/unspecial about the instanceof operator not to appear in intellisense?

  2. #2
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    448
    Rep Power
    1

    Default Re: Intellisense: instanceof not appearing

    I doubt that we could help you without details which IDE you are using and maybe an exact example where you see this behavior.

  3. #3
    jmohandos304 is offline Member
    Join Date
    Apr 2014
    Posts
    67
    Rep Power
    0

    Default Re: Intellisense: instanceof not appearing

    Java Code:
    public class MainApp {
    	static String name="Dinesh";  
    	static boolean result;
    
    	public static void main(String args[])
    	{
    		result=name ins
    //		System.out.println(name instanceof String);	
    	}
    }
    On line number 7 of the code just try to get instanceof operator from the intellisense, it selects something else with an if condition involving instanceof. I am using eclipse.

  4. #4
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    448
    Rep Power
    1

    Default Re: Intellisense: instanceof not appearing

    Ok, now I think I understand the issue.

    Seems that the intellisense of eclipse is a little limited. It requires a bracket before the identifier. So if you type "result = (name ins" and then Ctrl space, then you directly get the instanceof.
    Without the bracket eclipse seems to be lost. And you get a suggestion of a template that wants to give you a full if statement with assignment to a new variable which is a common thing (So it can be useful to have that, too).

    Just as a side note: I am using IntelliJ and the intellisense there seems to be much better. At least this case is done correctly (So I just type "boolean result = name ins" and I directly got the instanceof and all I had to do was pressing tab).

    With kind regards,

    Konrad

  5. #5
    jmohandos304 is offline Member
    Join Date
    Apr 2014
    Posts
    67
    Rep Power
    0

    Default Re: Intellisense: instanceof not appearing

    1. So the problem is with the intellisense?
    2. Does the IDE come with an intellisense?(Sorry for the stupid question)
    3. Can I change the intellisense in the eclipse which I have downloaded?

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    900
    Rep Power
    2

    Default Re: Intellisense: instanceof not appearing

    Either use a new IDE (I can recommend IntelliJ IDEA), or get used to typing "tanceof" after "ins".
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  7. #7
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    United States
    Posts
    3,375
    Rep Power
    5

    Default Re: Intellisense: instanceof not appearing

    That's a built in template. You can edit it and change it to behave the way you want or add a new one and use that.

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

Similar Threads

  1. instanceof question
    By tngo in forum New To Java
    Replies: 3
    Last Post: 02-18-2013, 12:23 AM
  2. Instanceof
    By KevinNguyen in forum New To Java
    Replies: 12
    Last Post: 11-08-2012, 05:55 PM
  3. instanceof
    By AedonetLIRA in forum New To Java
    Replies: 3
    Last Post: 12-01-2010, 12:34 AM
  4. Use of keyword instanceof
    By darek9576 in forum New To Java
    Replies: 3
    Last Post: 03-14-2010, 10:35 PM
  5. Replies: 5
    Last Post: 12-05-2009, 10:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •