Which Man class properly represents the relationship "Man has a best friend who is a Dog"?
Given: public class Target { private int i = 0; public int addOne(){ return ++i; } } And: public class Client { public static void main(String[] args){ System.out.println(new Target().addOne()); } } Which change can you make to Target without affecting Cl
Given: public class MyClass { public Integer startingI; public void methodA() { Integer i = new Integer(25); startingI = i; methodB(i); } private void methodB(Integer i2) { i2 = i2.intValue(); } } If methodA is invoked, which is true ?
Given classes defined in two different files: package packageA; public class Message { String getText() { return "text"; } } and: package packageB; public class XMLMessage extends packageA.Message { String getText() { return "text";} public sta
Which will compile and run without exception?
Given: public class Threads2 implements Runnable { public void run() { System.out.println("run."); throw new RuntimeException("Problem"); } public static void main(String[] args) { Thread t = new Thread(new Threads2()); t.start(); System.out.println("End
Given: NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(4); nf.setMinimumFractionDigits(2); String a = nf.format(3.1415926); String b = nf.format(2); Which statement are true about the result if the default locale is Locale.US?
Which statement concerning the use of the java.io.Serializable interface is true?
Given: public class MyLogger { private StringBuilder logger = new StringBuuilder(); public void log(String message, String user) { logger.append(message); logger.append(user); } } The programmer must guarantee that a single MyLogger object works properly
Given: class Line { public static class Point {} } class Triangle { // insert code here } Which code inserted, creates an instance of the Point class defined in Line?