<< < 1 2 3 4 5 6 7 8 9 > >>   Sort: Date

If I write System.exit (0); at the end of the try block, will the finally block still execute?
If I write System.exit (0); at the end of the try block, will the finally block still execute? No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus finally never executes.
2013-06-04, 3410👍, 0💬

Which arithmetic operations can result in the throwing of an ArithmeticException?
Which arithmetic operations can result in the throwing of an ArithmeticException? Integer / and % can result in the throwing of an ArithmeticException.
2013-01-16, 3366👍, 0💬

What is the difference between the Font and FontMetrics classes?
What is the difference between the Font and FontMetrics classes? The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.
2012-11-13, 3314👍, 0💬

Is it necessary that each try block must be followed by a catch block?
Is it necessary that each try block must be followed by a catch block? It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block OR a finally block. And whatever exceptions are likely to be thrown should be declared in the throws clause ...
2013-06-03, 3237👍, 0💬

What is the difference between a static and a non-static inner class?
What is the difference between a static and a non-static inner class? A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances.
2012-07-12, 3216👍, 0💬

How does Java handle integer overflows and underflows?
How does Java handle integer overflows and underflows? It uses low order bytes of the result that can fit into the size of the type allowed by the operation.
2012-07-02, 3162👍, 0💬

What is the first argument of the String array in main method?
What is the first argument of the String array in main method? The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name.
2013-05-06, 3134👍, 0💬

Is Empty .java file a valid source file?
Is Empty .java file a valid source file? Yes, an empty .java file is a perfectly valid source file.
2013-06-21, 3044👍, 0💬

What if the static modifier is removed from the signature of the main method?
What if the static modifier is removed from the signature of the main method? Program compiles. But at runtime throws an error "NoSuchMethodError".
2013-05-02, 3037👍, 0💬

Is next a keyword in Java?
Is next a keyword in Java? No, next is not a keyword.
2013-06-26, 3032👍, 0💬

Which package has light weight components?
Which package has light weight components? javax.Swing package. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.
2012-07-16, 3003👍, 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.
2013-06-21, 2985👍, 0💬

Which containers use a border Layout as their default layout?
Which containers use a border Layout as their default layout? The window, Frame and Dialog classes use a border layout as their default layout.
2012-09-13, 2910👍, 0💬

What are peerless components?
What are peerless components? The peerless components are called light weight components.
2012-07-17, 2887👍, 0💬

Calculating Total Weight of Subtree
Subject: Calculating Total Weight of Subtree --- Category: ,1, --- Question Can you write a computer code for the following problem: Given a text file with 3 comma-delimited columns of all integers: 'id', 'parent' and 'weight'. Each line represents a node identified by 'id'. 'parent' refers to 'id' ...
2014-01-02, 2882👍, 0💬

What is the difference between a Scrollbar and a ScrollPane?
What is the difference between a Scrollbar and a ScrollPane? A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.
2013-01-21, 2850👍, 0💬

Is main a keyword in Java?
Is main a keyword in Java? No, main is not a keyword in Java.
2013-06-25, 2848👍, 0💬

What' is Java?
What's Java? Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the feature set better resembles that o...
2012-05-15, 2848👍, 0💬

Can a public class MyClass be defined in a source file named YourClass.java?
Can a public class MyClass be defined in a source file named YourClass.java? No the source file name, if it contains a public class, must be the same as the public class name itself with a .java extension.
2013-07-02, 2778👍, 0💬

What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access
What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it? You do not need to specify any access level, and Java will use a default package access level.
2013-04-22, 2769👍, 0💬

What's the difference between J2SDK 1.5 and J2SDK 5.0?
What's the difference between J2SDK 1.5 and J2SDK 5.0? There's no difference, Sun Microsystems just re-branded this version.
2012-06-06, 2758👍, 0💬

Why are JSP pages the preferred API for creating a web-based client program?
Why are JSP pages the preferred API for creating a web-based client program? Because no plug-ins or security policy files are needed on the client systems(applet does). Also, JSP pages enable cleaner and more module application design because they provide a way to separate applications programming f...
2013-07-09, 2665👍, 0💬

What will be the output of the following statement? System.out.println ("1" + 3);
What will be the output of the following statement? System.out.println ("1" + 3); It will print 13.
2013-07-03, 2649👍, 0💬

Which containers use a border layout as their default layout?
Which containers use a border layout as their default layout? The Window, Frame and Dialog classes use a border layout as their default layout.
2012-05-30, 2609👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 > >>   Sort: Date