Underline the error and explain precisely the cause of the error

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

Following programs contain syntax/logical errors. Underline the error and explain precisely the cause of the error to get any credit. Just underlining will not be given credit. [2.5x2=5]

i. interface P{

void fun(int x) ;

}

------------------------

class S implements P{

public void funny(){

System.out.print(“OOP is funny”);

}

public static void main(String args[]){

S s1 = new S();

s1.funny()

}

}

 

 

ii. public class A{

int x;

void A(int x)

{ this.x=x;

System.out.println("in Class A");

}

public static void main(String[] args){

new A(5);

}

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Top down approach design
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
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT