ow is FunctionDefinitionNode and BuiltInFunctionDefinitionNode. Please add the appropriate parameters for BuiltInFunctionDefinitionNode to fix the error attached as an image.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Below is FunctionDefinitionNode and BuiltInFunctionDefinitionNode. Please add the appropriate parameters for BuiltInFunctionDefinitionNode to fix the error attached as an image. 

 

FunctionDefinitionNode.java

import java.util.List;
 
 
public class FunctionDefinitionNode extends Node {
private String name;
    private List<String> parameters;
    
 
    public FunctionDefinitionNode(String name, List<String> parameters) {
        this.name = name;
        this.parameters = parameters;
    }
 
    public String getName() {
        return name;
    }
   
    public List<String> getParameters() {
        return parameters;
    }
 
   
    public String ToString() {
        return "FunctionNode: [Name, Parameters]";
    }
 
}

 

BuiltInFunctionDefinitionNode.java

import java.util.HashMap;
import java.util.function.Function;
 
public class BuiltInFunctionDefinitionNode extends FunctionDefinitionNode {
private Function<HashMap<String, InterpreterDataType>, String> execute;
    private boolean isVariadic;
 
    public BuiltInFunctionDefinitionNode(Function<HashMap<String, InterpreterDataType>, String> execute, boolean isVariadic) {
        super(/* pass appropriate parameters to the superclass constructor if it exists */);
        this.execute = execute;
        this.isVariadic = isVariadic;
    }
 
    public String execute(HashMap<String, InterpreterDataType> parameters) {
        return this.execute.apply(parameters);
    }
}
9
package mypack;
import java.util.HashMap;
public class Built In FunctionDefinitionNode extends FunctionDefinitionNode
private Function<HashMap<String, InterpreterDataType>, String> execute;
private boolean isVariadic;
}
public Built In FunctionDefinitionNode (Function<HashMap<String, InterpreterDataType>, String> execute, boolea
super (/* pass appropriate parameters to the superclass constructor if it exists */)
this.exec The constructor Function DefinitionNode() is undefined
this.isVa
3 quick fixes available:
}
+ Add arguments to match 'Function Definition Node(String, List<String>)'
public String Change constructor 'Function DefinitionNode(String, List<String>)': Remove parameters 'String, List<String>'
return thCreate constructor 'Function DefinitionNode()'
}
Transcribed Image Text:9 package mypack; import java.util.HashMap; public class Built In FunctionDefinitionNode extends FunctionDefinitionNode private Function<HashMap<String, InterpreterDataType>, String> execute; private boolean isVariadic; } public Built In FunctionDefinitionNode (Function<HashMap<String, InterpreterDataType>, String> execute, boolea super (/* pass appropriate parameters to the superclass constructor if it exists */) this.exec The constructor Function DefinitionNode() is undefined this.isVa 3 quick fixes available: } + Add arguments to match 'Function Definition Node(String, List<String>)' public String Change constructor 'Function DefinitionNode(String, List<String>)': Remove parameters 'String, List<String>' return thCreate constructor 'Function DefinitionNode()' }
Expert Solution
Step 1: Description about code:

1- Do not declare the access modifier in front of the variable inside the FunctionDefinitionNode class.


2- extends the keyword used to inherit parent class features to the child class.


3- super keyword used to declare a constructor in the child class with parent class variable. 


4- Please check the following updated code and output screenshot.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Image Element
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education