<< < 16 17 18 19 20 21 22 23 24 25 26 > >>   Sort: Date

What is the difference between declaring a variable and defining a variable?
What is the difference between declaring a variable and defining a variable? In declaration we just mention the type of the variable and it's name. We do not initialize it. But defining means declaration + initialization. e.g String s; is just a declaration while String s = new String ("abcd"); Or S...
2013-05-14, 1983👍, 0💬

What is casting?
What is casting? There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to ...
2012-12-20, 1983👍, 0💬

What if the main method is declared as private?
What if the main method is declared as private? The program compiles properly but at runtime it will give "Main method not public." message.
2013-05-02, 1982👍, 0💬

What is the Java Virtual Machine?
What is the Java Virtual Machine? The Java Virtual Machine is a software that can be ported onto various hardware-based platforms.
2013-02-20, 1982👍, 0💬

Are true and false keywords?
Are true and false keywords? The values true and false are not keywords.
2013-01-04, 1982👍, 0💬

What classes of exceptions may be thrown by a throw statement?
What classes of exceptions may be thrown by a throw statement? A throw statement may throw any expression that may be assigned to the Throwable type.
2013-01-03, 1981👍, 0💬

What is Incremental Low Pause Collector?
What is Incremental Low Pause Collector? The incremental low pause collector is a generational collector similar to the default collector. The minor collections are done with the same young generation collector as the default collector. Do not use either -XX:+UseParallelGC or -XX:+UseParNewGC with t...
2013-03-27, 1980👍, 0💬

What is the result in program?
What is the result in program? public class test { public static void main(String [] args) { int x = 3; int y = 1; if (x = y) System.out.println("Not equal"); else System.out.println("Equal"); } } What is the result? A. The output is “Equal” B. The output in “Not Equal” C. An error at "...
2013-03-05, 1980👍, 0💬

How are Observer and Observable used?
How are Observer and Observable used? Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by obje...
2013-06-05, 1979👍, 0💬

What restrictions are placed on method overloading?
What restrictions are placed on method overloading? Two methods may not have the same name and argument list but different return types.
2013-04-01, 1977👍, 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-06-19, 1976👍, 0💬

Do not use the String contatenation operator in lengthy loops or other places where performance could suffer. Is that true?
Do not use the String contatenation operator in lengthy loops or other places where performance could suffer. Is that true? Yes.
2013-04-08, 1975👍, 0💬

What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body
What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement? The exception propagates up to the next higher level try-catch statement (if any) or results in the program's termination.
2013-01-18, 1972👍, 0💬

What type of parameter passing does Java support?
What type of parameter passing does Java support? In Java the arguments are always passed by value .
2013-05-16, 1971👍, 0💬

What Checkbox method allows you to tell if a Checkbox is checked?
What Checkbox method allows you to tell if a Checkbox is checked? getState()
2012-12-31, 1971👍, 0💬

Which Math method is used to calculate the absolute value of a number?
Which Math method is used to calculate the absolute value of a number? The abs() method is used to calculate absolute values.
2012-12-13, 1971👍, 0💬

What is the Java API?
What is the Java API? The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.
2013-02-20, 1970👍, 0💬

What are the different ways to handle exceptions?
What are the different ways to handle exceptions? There are two ways to handle exceptions, 1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and 2. List the desired exceptions in the throws clause of the method and let the caller of the method hadle th...
2013-05-31, 1969👍, 0💬

Can try statements be nested?
Can try statements be nested? Try statements may be tested.
2013-01-23, 1969👍, 0💬

Why are the methods of the Math class static?
Why are the methods of the Math class static? So they can be invoked as if they are a mathematical code library.
2012-12-28, 1968👍, 0💬

The superclass constructor runs before the subclass constructor ...
The superclass constructor runs before the subclass constructor ... The superclass constructor runs before the subclass constructor. The subclass's version of the overridable method will be invoked before the subclass's constructor has been invoked. If the subclass's overridable method depends on th...
2013-03-06, 1967👍, 0💬

Name the eight primitive Java types.
Name the eight primitive Java types. The eight primitive types are byte, char, short, int, long, float, double, and boolean.
2012-11-29, 1967👍, 0💬

When to Use the Incremental Low Pause Collector?
When to Use the Incremental Low Pause Collector? Use the incremental low pause collector when your application can afford to trade longer and more frequent young generation garbage collection pauses for shorter tenured generation pauses. A typical situation is one in which a larger tenured generatio...
2013-03-28, 1966👍, 0💬

How is it possible for two String objects with identical values not to be equal under the == operator?
How is it possible for two String objects with identical values not to be equal under the == operator? The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.
2012-12-28, 1965👍, 0💬

<< < 16 17 18 19 20 21 22 23 24 25 26 > >>   Sort: Date