Given the code fragment:Map<Integer, String> books = new TreeMap<>();books.put (1007, "A");books.put (1002, "C");books.put (1001, "B");books.put (1003, "B");System.out.println (books);What is the result?
Given the definition of the Vehicle class:class Vehicle {String name;void setName (String name) {this.name = name;}String getName() {return name;}}Which action encapsulates the Vehicle class?Vehicle class public.
Given:class Book {int id;String name;public Book (int id, String name) {this.id = id;this.name = name;}public boolean equals (Object obj) { //line n1boolean output = false;Book b = (Book) obj;if (this.name.equals(b name))}output = true;}return output;}}and the code fragment:Book b1 = new Book (101, "Java Programing");Book b2 = new Book (102, "Java Programing");System.out.println (b1.equals(b2)); //line n2Which statement is true?
Given:public class Canvas implements Drawable {public void draw () { }}public abstract class Board extends Canvas { }public class Paper extends Canvas {protected void draw (int color) { }}public class Frame extends Canvas implements Drawable {public void resize () { }}public interface Drawable {public abstract void draw ();}Which statement is true?Board does not compile.A.Paper does not compile.B.Frame does not compile.C.Drawable does not compile.D.E. All classes compile successfully.
Given the content of /resourses/Message.properties:welcome1="Good day!"and given the code fragment:Properties prop = new Properties ();FileInputStream fis = new FileInputStream ("/resources/Message.properties"); prop.load(fis);System.out.println(prop.getProperty("welcome1"));System.out.println(prop.getProperty("welcome2", "Test"));//line n1System.out.println(prop.getProperty("welcome3"));What is the result?
Given the definition of the Vehicle class:Class Vehhicle {int distance; //line n1Vehicle (int x) {this distance = x;}public void increSpeed(int time) { //line n2int timeTravel = time; //line n3class Car {int value = 0;public void speed () {value = distance /timeTravel;System.out.println ("Velocity with new speed"+value+"kmph");}}new Car().speed();}}and this code fragment:Vehicle v = new Vehicle (100);v.increSpeed(60);What is the result?Velocity with new speed -