Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I don't know how to fix this error pls help me!! 1 package ASS2; 3 import java.util.Scanner; 5 public class 01 6 public static void

I don't know how to fix this error pls help me!!image text in transcribed

1 package ASS2; 3 import java.util.Scanner; 5 public class 01 6 public static void main (String arugs[]) throws CloneNotSupportedException t testHexagon private static void testHexagon() throws CloneNotSupportedException Hexagon h1-new, Hexagons) System.out.print(" h1.setColor(kb.ne No enclosing instance of type Q1 is accessible. Must qualify the allocation with an enclosing instance of type Q1 (e.g. x.new System.out.printA() where x is an instance of Q1) if(kb . next()-: " 10 12 13 14 15 Press 'F2' for focus h1.setfilledGI else 17 18 19 20 h1.setfilled(false); System. out.print( "Side:" h1.setside(kb.nextInt)); System.out.println"First Hexagon " + h1.toString)+"nSide length: "+h1.getside()+". Area: "+ h1.getAea)+". Permiter: "+h1.getPerimeter)) Hexagon h2(Hexagon)h1.clone); System.out.println("Clonned hexagon."); System.out.println(h2.toString" Side length: "+h2.getside()+". Area: "+ h2.getArea+" Permiter: "+h2.getPerimeter)) 24 25 26 27 28 f (hl.compareTo(h2) System.out.println("Both Hexagon are identical.") System.out.println "The 2 hexagon are different."; else 30 32 static Scanner kb public abstract class Shape f new Scanner(System.in); 34 35 36 private String color; private boolean filled; //constructors protected Shape)fthis("White", true); protected Shape(String color, boolean filled) 38 39e 40 setColor(color); setFilled (filled) //methods public String getColorfreturn color:) public void setColor(String color)this.color-color;h public boolean isFilled()freturn filled;h public void setFilled (boolean f)filledf) public String toString() 43 45 46 47 48e 49 return "Color:"+color + ". "+ (filled? "Filled. ":"Not filled. "); public abstract double getArea); public abstract double getPerimeter; 52 53 54 public class Hexagon extends Shape implements ComparablecHexagon, Cloneablef public double permiter, area, side; public String color; public Boolean filled; 56 57 58e 59 60 ublic Hexagon) t ublic Hexagon(double side,String color, boolean filled public void setside (double setside) t 626 this.side-setside; 64 65e public double getside) return side; 67 68 public void setfilled (boolean setfilled) this.filled setfilled

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions