<< < 10 11 12 13 14 15 16 17 18 19 20 > >>   Sort: Date

You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: ArrayList or Li
You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: ArrayList or LinkedList? ArrayList
2013-04-16, 2404👍, 0💬

Can an anonymous class be declared as implementing an interface and extending a class?
Can an anonymous class be declared as implementing an interface and extending a class? An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
2012-10-15, 2404👍, 0💬

What are the problems faced by Java programmers who don't use layout managers?
What are the problems faced by Java programmers who don't use layout managers? Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints impo...
2012-07-25, 2404👍, 0💬

Can one create a method which gets a String and modifies it?
Can one create a method which gets a String and modifies it? No. In Java, Strings are constant or immutable; their values cannot be changed after they are created, but they can be shared. Once you change a string, you actually create a new object. For example: String s = "abc"; //create a new String...
2012-08-24, 2402👍, 0💬

What is the difference between Swing and AWT components?
What is the difference between Swing and AWT components? AWT components are heavy-weight, whereas Swing components are lightweight. Heavy weight components depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Uni...
2012-08-22, 2398👍, 0💬

How can you force garbage collection?
How can you force garbage collection? You can't force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.
2012-08-03, 2398👍, 0💬

What are some alternatives to inheritance?
What are some alternatives to inheritance? Delegation is an alternative to inheritance. Delegation means that you include an instance of another class as an instance variable, and forward messages to the instance. It is often safer than inheritance because it forces you to think about each message y...
2013-02-08, 2397👍, 0💬

Which containers may have a MenuBar?
Which containers may have a MenuBar? Frame
2012-10-30, 2397👍, 0💬

What is the argument type of a program's main() method?
What is the argument type of a program's main() method? A program's main() method takes an argument of the String[] type.
2012-10-24, 2397👍, 0💬

Which method of the Component class is used to set the position and size of a component?
Which method of the Component class is used to set the position and size of a component? setBounds()
2012-09-27, 2395👍, 0💬

How to check two arrays to see if contents have the same types and contain the same elements?
How to check two arrays to see if contents have the same types and contain the same elements? One of options is to use the equals() method of Arrays class. Arrays.equals(a, b); If the array types are different, a compile-time error will happen.
2012-09-06, 2394👍, 0💬

What is the common usage of serialization?
What is the common usage of serialization? Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.
2013-05-21, 2393👍, 0💬

What is the default value of an object reference declared as an instance variable?
What is the default value of an object reference declared as an instance variable? Null unless we define it explicitly.
2013-05-15, 2393👍, 0💬

What is a native method?
What is a native method? A native method is a method that is implemented in a language other than Java.
2012-10-08, 2393👍, 0💬

What is the List interface?
What is the List interface? The List interface provides support for ordered collections of objects.
2013-04-10, 2391👍, 0💬

Which Container method is used to cause a container to be laid out and redisplayed?
Which Container method is used to cause a container to be laid out and redisplayed? validate()
2013-04-12, 2389👍, 0💬

What method must be implemented by all threads?
What method must be implemented by all threads? All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface.
2013-06-17, 2385👍, 0💬

What is the difference between the prefix and postfix forms of the ++ operator?
What is the difference between the prefix and postfix forms of the ++ operator? The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.
2013-01-23, 2385👍, 0💬

Which containers use a FlowLayout as their default layout?
Which containers use a FlowLayout as their default layout? The Panel and Applet classes use the FlowLayout as their default layout.
2012-09-20, 2383👍, 0💬

What are order of precedence and associativity, and how are they used?
What are order of precedence and associativity, and how are they used? Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left
2012-10-09, 2381👍, 0💬

which characters may be used as the second character of an identifier, but not as the first character of an identifier?
which characters may be used as the second character of an identifier, but not as the first character of an identifier? The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.
2012-09-21, 2381👍, 0💬

What is clipping?
What is clipping? Clipping is the process of confining paint operations to a limited area or shape.
2012-10-08, 2380👍, 0💬

What is the preferred size of a component?
What is the preferred size of a component? The preferred size of a component is the minimum component size that will allow the component to display normally.
2012-09-19, 2380👍, 0💬

What is the difference between the String and StringBuffer classes?
What is the difference between the String and StringBuffer classes? String objects are constants. StringBuffer objects are not.
2012-11-06, 2379👍, 0💬

<< < 10 11 12 13 14 15 16 17 18 19 20 > >>   Sort: Date