Bug 197084 - Even though its compile time error. Why the following code is running?
Summary: Even though its compile time error. Why the following code is running?
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: Sun Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL: http://laratechnologies.com
Whiteboard:
Keywords:
: 197085 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-19 03:03 EDT by Niyas CLA
Modified: 2007-12-20 06:55 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Niyas CLA 2007-07-19 03:03:55 EDT
package com.lara;


interface PersonManager
{
	public static final double height = 25;
	void getData1();
}

class Manager1 implements PersonManager
{
	Manager1()
	{
		System.out.println("Why this is working ?");
	}
}

class InterfaceCheck
{
	public static void main(String[] args)
	{
		Manager1 ma1 = new Manager1();
	}
}
Comment 1 Olivier Thomann CLA 2007-07-19 08:37:34 EDT
*** Bug 197085 has been marked as a duplicate of this bug. ***
Comment 2 Olivier Thomann CLA 2007-07-24 15:40:41 EDT
This is working because with this code you don't hit the problem method.
If you write:
class InterfaceCheck
{
        public static void main(String[] args)
        {
                Manager1 ma1 = new Manager1();
                ma1.getData1();
        }
}

and you run it, you will get:

Why this is working ?
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
	The type Manager1 must implement the inherited abstract method PersonManager.getData1()

	at com.lara.Manager1.getData1(Manager1.java:4)
	at com.lara.InterfaceCheck.main(InterfaceCheck.java:7)

This works as expected.
Closing as INVALID.
Comment 3 Frederic Fusier CLA 2007-12-20 06:55:54 EST
Verified for 3.4M1