<< < 6 7 8 9 10 11 12 13 14 15 16 > >>   Sort: Date

The following statement prints true or false, why?
The following statement prints true or false, why? byte[] a = { 1, 2, 3 };, byte[] b = (byte[]) a.clone(); System.out.println(a == b); The false will be printed out. Because the two arrays have distinctive memory addresses. Starting in Java 1.2, we can use java.util.Arrays.equals(a, b) to compare wh...
2012-09-11, 2553👍, 0💬

What is the relationship between clipping and repainting?
What is the relationship between clipping and repainting? When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.
2012-11-30, 2550👍, 0💬

Is the numeric promotion available in other plantform?
Is the numeric promotion available in other plantform? Yes. Because Java is implemented using a platform-independent virtual machine, bitwise operations always yield the same result, even when run on machines that use radically different CPUs.
2012-07-03, 2550👍, 0💬

What comes to mind when someone mentions a shallow copy in Java?
What comes to mind when someone mentions a shallow copy in Java? Object cloning.
2013-04-15, 2547👍, 0💬

How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super(
How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super() used with constructors? The == operator compares two objects to determine if they are the same objects in memory. It is possible for two String objects to have the same v...
2012-08-01, 2547👍, 0💬

How are this() and super() used with constructors?
How are this() and super() used with constructors? this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.
2012-08-01, 2542👍, 0💬

Is "abc" a primitive value?
Is "abc" a primitive value? The String literal "abc" is not a primitive value. It is a String object.
2012-12-03, 2541👍, 0💬

Is the ternary operator written x : y ? z or x ? y : z ?
Is the ternary operator written x : y ? z or x ? y : z ? It is written x ? y : z.
2012-11-13, 2539👍, 0💬

Why Java does not support pointers?
Why Java does not support pointers? Because pointers are unsafe. Java uses reference types to hide pointers and programmers feel easier to deal with reference types without pointers. This is why Java and C-sharp shine.
2012-08-22, 2536👍, 0💬

What restrictions are placed on method overriding?
What restrictions are placed on method overriding? Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of the method it overrides. The overriding method may not throw any exceptions that may not be thrown by the overridden method...
2012-07-30, 2536👍, 0💬

What is the catch or declare rule for method declarations?
What is the catch or declare rule for method declarations? If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.
2012-10-11, 2535👍, 0💬

Does garbage collection guarantee that a program will not run out of memory?
Does garbage collection guarantee that a program will not run out of memory? No, it doesn't. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.
2012-06-25, 2534👍, 0💬

What is the benefit of subclass?
What is the benefit of subclass? Generally: The sub class inherits all the public methods and the implementation. The sub class inherits all the protected methods and their implementation. The sub class inherits all the default(non-access modifier) methods and their implementation. The sub class als...
2012-08-16, 2531👍, 0💬

Why Java does not support multiple inheritance ?
Why Java does not support multiple inheritance ? This is a classic question. Yes or No depends on how you look at Java. If you focus on the syntax of "extends" and compare with C++, you may answer 'No' and give explanation to support you. Or you may answer 'Yes'. Recommend you to say 'Yes'. Java DOE...
2012-08-31, 2530👍, 0💬

What modifiers may be used with an inner class that is a member of an outer class?
What modifiers may be used with an inner class that is a member of an outer class? A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.
2012-06-20, 2530👍, 0💬

How can a subclass call a method or a constructor defined in a superclass?
How can a subclass call a method or a constructor defined in a superclass? Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass's constructor.
2012-07-05, 2528👍, 0💬

What is the difference between the File and RandomAccessFile classes?
What is the difference between the File and RandomAccessFile classes? The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.
2012-08-06, 2526👍, 0💬

Can a Byte object be cast to a double value?
Can a Byte object be cast to a double value? No, an object cannot be cast to a primitive value.
2012-11-05, 2524👍, 0💬

What kind of security tools are available in J2SE 5.0?
What kind of security tools are available in J2SE 5.0? There are three tools that can be used to protect application working within the scope of security policies set at remote sites. keytool -- used to manage keystores and certificates. jarsigner -- used to generate and verify JAR signatures. polic...
2012-09-03, 2524👍, 0💬

How are the elements of a GridBagLayout organized?
How are the elements of a GridBagLayout organized? The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.
2012-07-24, 2524👍, 0💬

What if I write static public void instead of public static void?
What if I write static public void instead of public static void? Program compiles and runs properly.
2013-05-03, 2520👍, 0💬

Is null a keyword?
Is null a keyword? The null value is not a keyword.
2012-09-18, 2520👍, 0💬

Can an object's finalize() method be invoked while it is reachable?
Can an object's finalize() method be invoked while it is reachable? An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.
2012-10-03, 2519👍, 0💬

How to make an array copy from System?
How to make an array copy from System? There is a method called arraycopy in the System class. You can do it: System.arraycopy(sourceArray, srcOffset, destinationArray, destOffset, numOfElements2Copy); When you use this method, the destinationArray will be filled with the elements of sourceArray at ...
2012-09-04, 2517👍, 0💬

<< < 6 7 8 9 10 11 12 13 14 15 16 > >>   Sort: Date