Tag: technology
Questions Related to technology
What is the result of compiling and running this program? class Clove{ void quality(Clove m){ System.out.println("Clove is nice"); } } class Mint extends Clove{ void quality(Mint c){ System.out.println("Mint is ok"); } } class Sage extends Mint{ void quality(Sage h){ System.out.println("Sage is average"); } } public class Test{ public static void main(String[] args){ Clove h = new Sage(); Mint c = new Sage(); c.quality(h); } }
Given classes defined in two different files: 1. package util; 2. public class BitUtils { 3. public static void process(byte[]) { /* more code here */ } 4. } 1. package app; 2. public class SomeApp { 3. public static void main(String[] args) { 4. byte[] bytes = new byte[256]; 5. // insert code here 6. } 7. } What is required at line 5 in class SomeApp to use the process method of BitUtils?
Given: classA {} class B extends A {} class C extends A {} class D extends B {} Which three statements are true? (Choose three.)