What is the output and how to fix this code to get "swing swing 10" as an output? package rope; public class Rope { public static int LENGTH = 5; static { LENGTH = 10; } public static void swing() {...


What is the output  and how to fix this code to get "swing swing 10" as an output?





package rope;

public class Rope {

public static int LENGTH = 5;

static {

    LENGTH = 10;

  }

  public static void swing() {

    System.out.print("swing ");

  }

 }

import rope.*;

import static rope.Rope.*;

public class Chimp {

public static void main(String[] args) {

    Rope.swing();

    new Rope().swing();

    System.out.println(LENGTH);

  }

 }



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here