Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

prasanna w

+ Follow
since Mar 12, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by prasanna w

Can a Constructor specify exceptions in the header?
Well, as I found out by writing the following code, the answer is yes.
But according to Khalid Mughal's book, page 101, it is stated that "Constructors cannot specify exceptions in the header".
public class ConstructorTest {
private int i;
private String st;
// A public constructor throwing an exception.
public ConstructorTest(int j) throws Exception {
i = j;
System.out.println("Value of parameter is: " + i);

// Another public constructor throwing an exception.
public ConstructorTest(String s) throws Exception {
st = s;
System.out.println("Value of parameter is: " + st);

public static void main(String args[]) {
try {
ConstructorTest c1 = new ConstructorTest(10);
ConstructorTest c2 = new ConstructorTest("Passed");
catch(Exception e) {}

Output from the program -
Value of parameter is: 10
Value of parameter is: Passed
Could someone please elaborate?
Thank you
Thank you very much Mapraputa, what an excellent Applet to understand GridBagLayout!!! I am sure that with such a great tool at my disposal, I shall surely understand this LM, and will be able to answer a question on GBLM if it asked on the test. Thank you again.
It seems that maybe 7 out of 10 people get a question on GridBagLayout (correct me if I am wrong). While it may seem sensible to skip it, but I would still like to give it a try because I am getting the lowest scores on "very easy question" categories in the mocks! I am unable to figure out the reason for this.
So I think that if I answer the easy questions incorrectly in the test, I should have the extra padding of answering the tough questions correctly. May seem a little weird, but I think it makes sense. What do the JavaRanchers have to say ?
19 years ago
I suppose this question has been answered before... If not, someone please tell me, or provide me the link to the answer, as a considerable amount of time would be needed to study this Layout Manager.
If it is not asked on the test, I might as well skip studying it, and concentrate on other important topics like Threads, OO, I/O, etc.
19 years ago
All the best Revati, you sure are well prepared!
I have registered my exam for the 27th April, hope I won't have to re-schedule...
Kriti, JCP is not Java Control Process, it is Java Community Process, a sort of a consortium, where anyone (even individuals) who think they have an idea for a new technology, or a way to enhance a existing technology can contribute their expertise by becoming a lead in that particular Process.
eg. Nokia and Motorola are the leads for the J2ME JCP.
Javaranch Sheriffs, please correct me if I am wrong(I don't think so)
19 years ago
hi all
I am preparing for SCJP2, and I am from Mumbai. It is a pleasure to join this group, we can definitely benefit from this.