For the given code below, which lines are valid (will compil…

For the given code below, which lines are valid (will compile and run)? Assume each line is run independently.   public class Bottle {     private static boolean plastic;     private char letter;     public static int trash() {        return 0;     }     public boolean recycle() {        return true;     }     public static void main(String   2  :   3  :   4  :   5  :   6  :   7  :   8  :

Complete the following code. Make sure to complete the code…

Complete the following code. Make sure to complete the code in such a way that doesn’t invalidate the comments and that no implicit conversions are taking place on assignments of primitive data types.  public class Test {     public static void main(String         // get an integer value from the user         percent =           // get a double value from the user         price =            // compute sale         double sale = price * (percent/100.00);         // print sale to 1 decimal place        } } 

Write a class with a legal name of your choosing. Your class…

Write a class with a legal name of your choosing. Your class should satisfy the following requirements: Have only one constructor that takes no arguments. Have a field that holds a count of how many instances of the class (i.e. objects) have been created. This field should be shared among all instances. Use proper encapsulation The object count should not be mutable from outside the class. A single accessor method should be written to retrieve the object count. No other methods are required. Make sure to select the ‘Preformatted’ style from the dropdown so your code is formatted clearly. DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.