Question: Answer the following Java Questions The relationship between a class and an object is best described as A) classes are instances of objects C) classes
The relationship between a class and an object is best described as A) classes are instances of objects C) classes are programs, objects are variables B) objects and classes are the same D) objects are instances of classes 2. An)is passed by AWT as an argument to the ActionPerformed method A) Button B) ActionEvent ItemEvent D) ActionListener 3, Th lifetime of a formal parameter is A) during execution ofthem thod B) entire duration of the program C) same as the lifetime of the object D) same as the lifetime of the caller 24. Referring to the figure on the right, which of the following public class C1 lists of instance variables are A) x, y, z, a, b, q B) a, q accessible in C3 C) a, b, q D) x, z, a, q public int x private int y protected int Z 5. Suppose you have the following class hierarchy Guitar is a subclass of Instrument public class C2 extends C1 AcousticGuitar is a subclass of Guitar .ElectricGuitar is a subclass of Guitar Given the declarations below, which of the objects CANNOT be passed to the method tune(Guitar g)? A) AcousticGuitar aGuitar protected int a private int b public class C3 extends C2 private int q B) ElectricGuitar eGuitar D) Guitar myGuitar A Font consists of A) type, size, metric B) name, style, size 6. C) class, attributes, mode D) color, shape, size Which of these is a class that is never instantiated A) static class B) final class C) inner class D) abstract class 8. Which of these draws a circle? A) g.drawoval 100,50,100,100) C) g.drawOvalo,100.90,50) B) g.drawOval(50,100,5,50) D) g.drawoval(50,50,100,75) 9. When a class implements an interface, it must: A Redefine its instance variables C)Call its start method B) Implement its methods D) Instantiate the interface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
