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

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, 3602👍, 0💬

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, 3540👍, 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, 3414👍, 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, 3379👍, 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, 3343👍, 0💬

What are peerless components?
What are peerless components? The peerless components are called light weight components.
2012-07-17, 3306👍, 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, 3269👍, 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, 3262👍, 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, 3249👍, 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, 3218👍, 0💬

Is next a keyword in Java?
Is next a keyword in Java? No, next is not a keyword.
2013-06-26, 3174👍, 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, 3149👍, 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, 3148👍, 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, 3113👍, 0💬

What is the difference between a MenuItem and a CheckboxMenuItem?
What is the difference between a MenuItem and a CheckboxMenuItem? The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.
2012-10-11, 3086👍, 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, 3078👍, 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, 3028👍, 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, 3027👍, 0💬

Is main a keyword in Java?
Is main a keyword in Java? No, main is not a keyword in Java.
2013-06-25, 3001👍, 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, 2989👍, 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, 2978👍, 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, 2939👍, 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, 2922👍, 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, 2869👍, 0💬

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