Unable to implement Method

Can someone please examine these lines of code and help me to resolve error? Thank You, Markus
 Warning 1
The field 'RectangleApplication.TableTop.cost' is never used
Warning
2
'RectangleApplication.TableTop.Display()' hides inherited member 'RectangleApplication.Rectangle.Display()'. Use the new keyword if hiding was intended.
namespace RectangleApplication
    class Rectangle
        //member variables
        protected double length;
        protected double width;
        public Rectangle(double l, double w)           
            length = l;
            width = w;
        public double GetArea()                   ///Function Call
            return length * width;
        public void Display()
            Console.WriteLine("Length: {0}", length);
            Console.WriteLine("Width: {0}", width);
            Console.WriteLine("Area: {0}", GetArea());
    //end class Rectangle
    class Table     {
        private double cost;                               //error code
        public  TableTop(double l, double w) : base(l,w)
        public double GetCost()
            double cost;
            cost = GetArea() * 70;                  //this tells me ToString call GetArea method??
            return cost;
        public void Display()           //error code
            base.Display();
            Console.WriteLine("Cost {0}", GetCost());
    class ExecuteRectangle
          static void Main(string[] args)
       TableTop  t = new TableTop (4.5, 7.5);        //this asks for the TableTop method???
       t.Display();
       Console.ReadLine();
Andrew Coleman

To solve the first issue, remove the line:
    private double cost;
To solve the second issue, add virtual to the first Display:
    public virtual void Display()
then add override to the second Display:
    public override void Display()

Similar Messages

  • Not able to get current user in PCD Filter factory implementation method

    hi all,
      In the  PCD Filter factory implementation method . i am using the following code
    public Object getObjectInstance(Object arg0, Name arg1, Context arg2, Hashtable env)
         throws Exception
              if (Constants.ASPECT_NAVIGATION.equals(env.get(Constants.REQUESTED_ASPECT)))
              IUser user = (IUser) env.get(IPcdContext.SECURITY_PRINCIPAL);
              String department="null";
              if (user != null)
                 department=user.getDepartment();
                   if ((department != null) && (!department.equals("")))
              filterExpression = "(" + FilterDepartmentService.Department_ATTRIBUTE_KEY + "=" + department + ")";                             
              return filterExpression;
    but i cannot able to get the current user. how to get the current user in the above method..
    Regards,
    Shanthakumar.

    Hi,
      First print the output for env.get(IPcdContext.SECURITY_PRINCIPAL);
    If it returns null, set it from the request object first (from the method where Hashtable is declared and request obj is available) and then use it in this getObjectInstance method.
    env.put(IPcdContext.SECURITY_PRINCIPAL, request.getUser());
    Regards,
    Harini S

  • Calling an implemented method from an external class.

    Hey guys...
    I'm writing a package to be put into a program I'm writing for a project (for Uni), but I also want to use the package in other programs.
    Basically, the package will return a JScrollPane that can be put into any JFrame or JPanel or whatever.
    It draws boxes on the JScrollPane in different colours and locations depending on what information is passed to it (kind of like iCal or Microsoft Outlook Calendar), and is to be used for a Resource Allocation Program that requires drag and drop of boxes for moving bookings around etc.
    http://www.pixel2.com.au/ethos/class_diagram.png
    This is a copy of the class diagram for the relevant classes. ViewFrame is the class that instantiates the JScrollPane (AllocationTable). It implements the AllocationInterface to implement methods such as moveAllocation() newAllocation() etc.
    BookingPanel is the content pane for the JScrollPane. AllocatedBox is the individual bookings, or boxes that are painted onto the BookingPanel.
    BookingPanel implements ActionListener, MouseListener and MouseMotionListener, which enables drag and drop functionality.
    What I want to do, is when mouseReleased() is called by dropping a box, call the method moveAllocation() in ViewFrame to make the changes to the database to move the booking around.
    I don't know how to access that from BookingPanel as the name of ViewFrame will change obviously for different programs.
    If you could help me out, that would be great!
    If you need anything else explained, please let me know.
    Thanks,
    Ryan.

    LeRyan wrote:
    Hey guys...
    I'm writing a package to be put into a program I'm writing for a project (for Uni), but I also want to use the package in other programs.
    Basically, the package will return a JScrollPane that can be put into any JFrame or JPanel or whatever.I think you have some terminology issues that might stand in your way of getting help or understanding the issues. A Package is a grouping of classes, so a package doesn't return anything...
    It draws boxes on the JScrollPane in different colours and locations depending on what information is passed to it (kind of like iCal or Microsoft Outlook Calendar), and is to be used for a Resource Allocation Program that requires drag and drop of boxes for moving bookings around etc.So from your description of the function of this thing, I think you mean a class - some sort of JComponent?
    >
    http://www.pixel2.com.au/ethos/class_diagram.png
    This is a copy of the class diagram for the relevant classes. ViewFrame is the class that instantiates the JScrollPane (AllocationTable). It implements the AllocationInterface to implement methods such as moveAllocation() newAllocation() etc.
    BookingPanel is the content pane for the JScrollPane. AllocatedBox is the individual bookings, or boxes that are painted onto the BookingPanel.
    BookingPanel implements ActionListener, MouseListener and MouseMotionListener, which enables drag and drop functionality.
    What I want to do, is when mouseReleased() is called by dropping a box, call the method moveAllocation() in ViewFrame to make the changes to the database to move the booking around.
    I don't know how to access that from BookingPanel as the name of ViewFrame will change obviously for different programs.
    If I follow, and I am not sure that I do - you want a reference to the ViewFrame in the BookingPanel. So either on construction of the BookingPanel via a parameter in the constructor, or as a separate step via a setter, place a reference to the ViewFrame in BookingPanel. Then when you call mouseReleased you can call moveAllocation through that reference.
    If you could help me out, that would be great!
    If you need anything else explained, please let me know.
    Thanks,
    Ryan.

  • Error "Unable to find method:key" on UM configuration iView

    When i try to click on the UM configuration in System Administration --> System configuration i am getting the Error Unable to find method:key  Does any one came across the same Issue. Please help ?

    Server restart should help. See note 792929.

  • Unable to see method exception EXECUTE_ASYNCRONOUS in sproxy

    Hi,
    I am trying a file to proxy scenario for the inbound message interface(Aync-inbound) I made and configured
    the scenario for file 2 proxy but in R3 side "Sproxy" --> create proxy with prefix as cl_ and generate proxy.
    But in method exception under my class i donot see EXECUTE_ASYNCRONOUS, Instead i see my Inbound message interface name.
    Why i am not able to see the EXECUTE_ASYNCRONOUS in method exception.
    Regards,
    Anirban.

    Hi Anirban,
    Execute_Asynchronous or Execute_Synchronous method does not exists any more in XI 7.0 SP 14 or higher.
    Don't worry about this. There will be method with the same name as your Interface Name. Write your code inside that and you will be good to go. We have recently implemented the same and it works absolutely fine.
    Thanks
    Amit

  • Abstract Method in a Class with implemented method

    I have a class which already has methods Implemented.I mean thse metgods are not abstract.I want only one method to be abstarct which will be overrideen by its subclass or derived Class
    I have never tried this
    Does anyone knows how to do this
    If yes could you give me syntax of the method
    Thanks in advance
    CSJakharia

    javax.swing.JComponent is an example of an abstract
    class with no abstract methods. That is why the
    following works:
    JComponent component = new JComponent(){};
    Not to forget you cannot instantiate abstarct classes
    public abstract class Test
    public String getName()
    return "Mike";
    public static void main(String[] args)
    Test tt = new Test();
    System.out.println(tt.getName());
    }and you would get the error
    The type Test cannot be instantiated.
    You remove the abstract keyword and it would compile
    good.No I am not misinterpreting I know what he is saying but I am closing the door of misinterpretation which I felt was possible. ;)
    cheers

  • CRM 7.0 implement method from MVC class

    Hello, folks.  I will prefix my question with the fact that I am a relative dinosaur in the development arena, still focused primarily procedural coding practices.  Although this still serves me well, it also means that I know little about OO development.  I have had some training and can make use of such common tools as OO ALV.  However, I know next to nothing about MVC (model view controller) programming, WEB Dynpro for ABAP, etc.  I am currently assigned to a CRM project (I am also new to CRM) and have a particular requirement that I cannot seem to address with any sort of procedural-based solution (i.e. function module).
    My requirement is to create a "URL Attachment" to a service request in CRM.  To elaborate, I have created an inbound point-to-point interface (i.e. not PI/XI) from an external system using Web Services.  The Web Service I have created ultimately invokes a call to function CRMXIF_ORDER_SAVE via a wrapper function I developed with the same interface.  This function, however, does not support the creation of "URL Attachments", only "Attachment Links".  So, my approach then is to implement additional functionality in my wrapper function to create this URL Attachment via some other means.  If you have any questions regarding URL Attachments vs. Attachment Links, please let me know.
    I have scoured the function modules to no avail.  What I have found is that via MVC, the functionality on the CRM Web UI is associated with the following class: CL_GS_CM_ADDURL_IMPL.  A search in SE24 reveals that there are actually several related? classes:
    CL_GS_CM_ADDURL
    CL_GS_CM_ADDURL_CN02
    CL_GS_CM_ADDURL_CN03
    CL_GS_CM_ADDURL_CTXT
    CL_GS_CM_ADDURL_IMPL
    My question is whether I can somehow implement one of these classes to address my requirement.  Looking at the logic within the IP_TO_ADDURL method, I cannot figure out whether I can somehow leverage this and, if so, exactly what coding would be required in my wrapper function.  I should also point that, at least from a Web UI point of view, this is a two step process whereby you must first create the attachment and the actually save it. 
    Any and all insights are much appreciated.
    Thanks.

    Hi there,
    I am not familiar with the CRM classes you mention - but what you describe is pretty much standard functionality included in Generic Object Services. May that path will lead you home.
    Cheers
    Graham Robbo

  • How to implement Method output converion in BADI HRPAD00INFTYUI

    Hi All,
    I have to implement Output conversion method in HRPAD00INFTYUI for the requirement of adding custom field in the structure HRWPC_S_EP_COMMUNICATION. Usage is, In MSS general data service the manager should see his subordinates telephone extn number and his mobile number.
    While trying to add, system is asking for access key and one possible solution is append structure. I am confused after seeing the parameters in that BADI. Anyone please give solution for the above requirement. Please share code as well if you have.
    Thanks in Advance.
    S.Vikgnesh

    I am curious: can you explain WHY you want method level security? It seems woefully overkill and paranoid to me - server level security should be enough to keep out rogue code.
    Anyway for that level of security, the security measures built into the JVM should be used.
    [Java Security documentation|http://java.sun.com/javase/technologies/security/]
    You can also look into a security API like Spring security - be warned though, it has a steep learning curve.

  • How to implement method level authorisation in JSF

    Hi all,
    I am new to JSF 2. I have been able to implement authorization on my web pages, but I also want to implement it at the bean level. Does JSF 2 provide an in-built functionality to implement role-based authorization on bean methods? Or, I need to use some security frameworks (i.e. ACEGI)?
    Thanks in advance,
    Neeraj

    I am curious: can you explain WHY you want method level security? It seems woefully overkill and paranoid to me - server level security should be enough to keep out rogue code.
    Anyway for that level of security, the security measures built into the JVM should be used.
    [Java Security documentation|http://java.sun.com/javase/technologies/security/]
    You can also look into a security API like Spring security - be warned though, it has a steep learning curve.

  • Implementing methods in user interface

    hi how can i implement my tested methods im my user interface which class must i right click to create data control,or there is another way
    Edited by: Tshifhiwa on 2012/05/03 11:23 PM

    What methods are you talking about and what do you want to call from UI .?

  • Implement method inside abstract class?

    hello everyone:
    I have a question regarding implementation of method inside a abstract class. The abstract class has a static method to swamp two numbers.
    The problem ask if there is any output from the program; if no output explain why?
    This is a quiz question I took from a java class. I tried the best to recollect the code sample from my memory.
    if the code segment doesn't make sense, could you list several cases that meet the purpose of the question. I appreciate your help!
    code sample
    public abstract class SwampNumber
       int a = 4;
       int b = 2;
       System.out.println(a);
       System.out.println(b);
       swamp(a, b);
       public static void swamp(int a, int b)
         int temp = a;
             a = b;
             b = a;
         System.out.println(a);
         System.out.println(b);

    It won't compile.
    You can't instantiate an abstract class before you know anything.
    //somewhere in main
    SwampNumber myNum = new SwampNumber();
    //Syntax ErrorQuote DrClap
    This error commonly occurs when you have code that >>is not inside a method.
    The only statements that can appear outside methods >>in a Java class are >>declarations.Message was edited by:
    lethalwire

  • Service Implementation methods in SEGW Transaction

    Hi Experts,
    I have created a project using SAP NetWeaver Gateway Service. In service implementation node, there is five methods. In this section, I have faced problems and have confusion. I am trying to explain my problems in below -
    1. What are purpose for every individual method? In which requirement, which method I need to implement ?
    2. Suppose I have implemented all five methods individually and I want to test the update method. How to execute update method and get_entity_set method in browser?
    Kindly provide the details for above problems.
    Thanks in Advanced,
    Regards,
    Arindam Samanta

    Hi Arindam,
    you can refer my blog Let’s code CRUDQ and Function Import operations in OData service! where I explained purpose of individual method and its implementation.
    Regards,
    Chandra

  • Implementing method and add 'synchronized' keyword

    Basically, I have the following scenario:
    public interface ClassA {
      public void doSomething(String s);
    } Then, the class that implements ClassA:
    public class ClassB implements ClassA {
      public ClassB() {
        doSomething("Testing");
      public synchronized void doSomething(String s) {
        // Do something...
      public static void main(String[] args) {
        ClassB cb = new ClassB();
    }ClassB implements the doSomething(String s) method but adds the 'synchronized' keyword. I compile this and get no errors, but I wanted to make sure that adding the 'synchronized' keyword to a method that is implemented is a legit thing to do.
    The reason I am asking is that Rational Rose does not generate code for this situation correctly, and before I call tech support, I wanted to make sure that it is not a problem with what I am doing. When Rose generates the code, it gives a warning that the method doSomething was not implemented and it adds the method. I then have two methods called 'doSomething'.
    Thanks

    'synchronized' is not part of the method signature. But if you want to work around the problem, instead of declaring the method as synchronized, simply do this instead, which is equivalent (for non-static methods):
    public void doSomething(String s) {
      synchronized (this) {
        // your code here

  • AIM (Application Implementation Method)

    I am looking for the latest version of the AIM software.
    Can't seem to find it on Metalink nor Technet though.
    Can anybody point me to the correct url to download the AIM executable?
    Thenks,

    Hi,
    From what I've found out is that irrespective of the methodology in question, you've to tweak it as per your need in order to have a successful implementation for Hyperion Planning. The degree of customisation may vary from one method to another.

  • Unable to implement JUErrorHandler

    I'm trying to make my application show the simple error dialog every time jbo raise exception, not the error dialog of class JUErrorHandlerDlg.
    I had already implemented JUErrorHandler and overrided method reportException() but it's still not work.
    My code:
    public class FormCurrenciesView extends JFrame implements JUErrorHandler
    public static void main(String [] args)
    try
    JUApplication app = JUMetaObjectManager.createApplicationObject(...);
    JUPanelBinding panelBinding = new JUPanelBinding(...);
    app.getApplicationModule().fetchAttributeProperties(...);
    panelBinding.setApplication(app);
    FormCurrenciesView1 frame = new FormCurrenciesView(panelBinding);
    JUMetaObjectManager.setBaseErrorHandler(frame);
    catch(Exception ex)
    JUMetaObjectManager.reportException(null, ex);
    System.exit(1);
    public void reportException(JUFormBinding formBnd, Exception ex){
    JOptionPane.showMessageDialog(null, ex.getMessage(), "Error", JOptionPane.INFORMATION_MESSAGE);
    Pls help me to solve this problem.
    Thanks.

    Sorry, I mean the JOptionPane.ShowMessageDlg() function doesn't show error dialog as it's supposed to do. The error handler, instead, print its error stacktrace in Jdev's debug window.
    One more thing, I has tested my application with some changes:
    I write a new class name MyJUErrorPane which is also implemented JUErrorHandler and overrided method reportException, my code right now is:
    1: JUMetaObjectManager.setBaseErrorHandler(new MyJUErrorHandler());
    2: JUApplication app = JUMetaObjectManager.createApplicationObject(...);
    3: JUPanelBinding panelBinding = new JUPanelBinding(...);
    4: app.getApplicationModule().fetchAttributeProperties(...);
    5: panelBinding.setApplication(app);
    6: FormCurrenciesView frame = new FormCurrenciesView(panelBinding);
    The above code worked perfectly, class MyJUErrorHandler show the error mess correctly. But when I moved the top line to the bottom (moved line 1 to line 7)... nothing show but the stacktrace on debug window.
    Have you got any idea ???
    Thank you for your reply.

Maybe you are looking for

  • Transfer of JPG Attachment through web method using BASE64 encoding

    Hello! I have an existing ABAP program which sends information (.txt file) by calling a web module. I need to change this program so  that users can attach a .Jpg image. The image has to be sent along with the other information by calling the web mod

  • Clear shift registers between runs

    Hi, Noob question of the day! I am building an array and would like to clear shift registers between runs. I have attached a VI. It runs a while loop every second and adds that iteration number to an array. I then display the length of the array. I w

  • Directory List from XML

    I would outsource this section of a Flash site to someone who understands actionscript and xml. The section that needs to be created is a project title directory. The project title list or directory: 1. needs to be created from an existing XML file.

  • Help Resolve this ERROR please!!!!!!

    I have had an iweb site, however today I have started to receive this error message when I try and view images in the photo gallery. The rest of the site works fine the blog etc. The Error message is SORRY but we can't find the iWeb page you've reque

  • Reports directory

    Hi, is the reports directory or reports noad registered in any table ? In which ? Thank you.