This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Rashmi Hosalli

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

Recent posts by Rashmi Hosalli

Way back in 2001, I became a Sun certified Java Programmer and during that time I used this website a lot. After a long pause, I want to refresh my java skills. I am kinda lost and am wondering how to pick up where I left off and begin my java career. Any suggestions/ tips?
1 year ago
Thank you everybody!
Rashmi
18 years ago
Hi,
I passed my SCJP exam today with 83%.My sincere thanks to e'body at javaranch.
I did plenty of mock exams and did all the tests in JQPlus.After doing the tests, I took almost the same time to analyse my wrong answers!JQPlus was a great help and I did find a couple of similar questions in the actual exam!For the last day,I just went thro' the io section in Velmurugan's notes(suggested by somebody in javaranch!!) and guess what...I scored 100% in I/O!
Thanks again for the help provided.
Rashmi
18 years ago
Hi,
I have a couple of doubts.
1.Which method declarations will enable a class to be run as a standalone program?
Will "static void main(String[] args)" be considered wrong? I did read the explanation given in JQplus,however it doesn't say why this choice is not given any value.
2.Can color of the text on a Button be changed by using setForeground?
I don't think so...Could anyone please let me know about this.
Regards,
Rashmi
Hi ravish,
I know I did post for a similar/same Q, but this was and is my doubt which unfortunately still remains unanswered!!!
Rashmi.
Thank you Marilyn,rajashree and Shyamsundar.
My sincere thanks to e'one.I think I know what I should be doing now!
Rashmi
Question ID :960680664920
Overriding method cannot throw new exceptions that are not thrown by the overridden method.
Correct Answer:false!!!
Does it include Runtime Exceptions?
Thanks,
Rashmi
A try statement must always have a ............. associated with it.

1. catch
2. throws
3. catch,finally or both
4. throw
5. finally
Why is finally wrong as the word "must" is emphasised?
Rashmi
Question ID :952739431860
Given the following program, which one of these statements is true?
public class TestClass extends Thread
{
static Object lock1 = new Object();
static Object lock2 = new Object();
static volatile int i1, i2, j1, j2, k1, k2;
public void run()
{
while (true)
{
workWithLocks();
workWithoutLocks();
}
}
void workWithLocks()
{
synchronized(lock1) { i1++ ; i2++; }
synchronized(lock2) { k1++ ; k2++ ; }
j1++; j2++;
}
void workWithoutLocks()
{
if (i1 != i2) System.out.println("i");
if (j1 != j2) System.out.println("j");
if (k1 != k2) System.out.println("k");
}
public static void main(String args[])
{
new TestClass().start();
new TestClass().start();
}
}
Answer given is:
One cannot be certail whether any of the letters i,j and k will be printed during execution.
While I agree with this,I also feel that the other option which states that "One can be certain that the letters i and k will never be printed" is also true as i and k are incremented together.Please clarify.
Regards,
Rashmi
Hi,
This question is from jqplus.It goes like this:
Consider:
public class Outer
{
int i = 10;
class Inner
{
public void methodA()
{
//line 1.
}
}
}
Which of the following statements are valid at line 1 (Select the best answer).
1. System.out.println(this.i);
2. System.out.println(i);
3. System.out.println(Outer.this.i);
4. i cannot be accessed inside the inner class method.
Answer given is 3.
Isn't 2. also correct?How does one decide?
Thanks,
Rashmi.
Thank you Jose and Manish.
Hi Manish,
Thanks for the explanation.I have one doubt and I request you to please clarify the same...
In the sample code you gave:
class B
{
public static void foo()
{
System.out.println("Inside Base foo"); }
}
public class D extends B
{
public static void foo( )
{
System.out.println("Inside Derived foo");
}
public static void main(String args[])
{
B obj = new D();
obj.foo(); //prints Inside Base foo }
}
if the static is removed from the foo method, it prints "Inside Derived foo".So,what role does static play in such situations.Can such methods be overridden?
Regards,
Rashmi
Two class files A$1$B.class and A$2$B.class are created as A.java has two constructors and both of them have inner classes.
Rashmi
Kavitha,
since you have said that there is no "Hello.txt" in the current directory,when you run the pgm you get a FileNotFoundException due to which after executing finally it returns.However,if you have "Hello.txt" in the directory,then you get the output as
Doing finally
0
Rashmi