Amit, Jhalani

Greenhorn
+ Follow
since Jan 11, 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 Amit, Jhalani

Hi All,
I am alos planning to appear in the and of april. I am from jacksonville Florida.
Please include me in ur group.
Thanks
Amit Jhalani
Please forward to me too.
My email addr : amit_jhalani@hotmail.com
Thanks in advance.
Amit

Originally posted by rajani adapa:
Which of the following most closely describes the process of overriding?
1) A class with the same name replaces the functionality of a class defined earlier in the hierarchy
2) A method with the same name completely replaces the functionality of a method earlier in the hierarchy
3) A method with the same name but different parameters gives multiple uses for the same method name
4) A class is prevented from accessing methods in its immediate ancestor
ANSWER:
2) A method with the same name completly replaces the functionality of a method earlier in the hierarchy
Option 3 is more like a description of overloading. I like to remind myself of the difference between overloading and overriding in that an overriden method is like something overriden in the road, it is squashed, flat no longer used and replaced by something else. An overloaded method has been given extra work to do (it is loaded up with work), but it is still being used in its original format. This is just my little mind trick and doesn't match to anything that Java is doing.
I CANNOT UNDERSTAND Y OPTION 3 IS NOT CORRECT.


Rajani your question is about overriding hance option 3 is not correct. It will be correct for overloading.
Hope this help
Amit

[This message has been edited by Amit, Jhalani (edited February 01, 2001).]
Thanks Art, But String is a class in java, which means can we use any valid java class name as a valid variable name?
Please explane.
Amit
Hi,
Can some one tell me why the following statement is correct. This question is from JQplus.
String String = "string isa string";
Thanks in advance.
Amit
import java.util.*;
public class Q5 {
public static void main (String[] args) {
Q5 obj = new Q5();
Vector vectorDemo = new Vector(10);
Vector vectorDemo1 = new Vector();
System.out.print(vectorDemo.size() + ",");
System.out.print(vectorDemo.capacity() + ",");
System.out.print(vectorDemo1.size() + ",");
System.out.print(vectorDemo1.capacity());
}
}
I think the correct answer would be 1,5,7 but the correct answer given is 1,4,6 can some one explane.
Thanks
Amit
Sorry the complete question is as follows
Given:
import java.util.*;
public class Q5 {
public static void main (String[] args) {
Q5 obj = new Q5();
Vector vectorDemo = new Vector(10);
Vector vectorDemo1 = new Vector();
System.out.print(vectorDemo.size() + ",");
System.out.print(vectorDemo.capacity() + ",");
System.out.print(vectorDemo1.size() + ",");
System.out.print(vectorDemo1.capacity());
}
}
Select Three answers?
Compilation error occurs if " import java.util.* " is not included.
Prints 0,10,0,10 vertically.
Prints 0,10,0,0 Horizontally.
Prints 0,10,0,10 Horizontally.
Prints 0,10,0,0 vertically.
Line 6 defines an empty Vector with an initial capacity of 10. When the vector needs to increase its capacity, the capacity " doubles ".
Line 6 defines an empty Vector with an initial capacity of 0.
[This message has been edited by Amit, Jhalani (edited January 30, 2001).]
public class Test
{
static int x = 9;
static int y = 'V';

public static void processInt(int i)
{
i = 18;
process(y);
}

public static void process(long l)
{
l = 27;
}

public static void process(short s)
{
s = 36;
}

public static void main(String[] args)
{
processInt(x);
System.out.println(x);
System.out.println((char)y);
}
}
can some one please explae the answer to me.
Correct answer is 9 and 'V'.
Thanks in advance
Amit
I also think it should say won't compile.
Amit
Hi,
For SCJP we have to use jdk1.2
Amit
Thanks Marine,
Got confuse with a questrion. Thanks again.
Amit
Hi,
Can somebody help me to understand drawString() method with an example.
Thanks in advance
Amit
Hi,
resume() and suspend() are now Deprecated. Hence questions related to these methods will not be asked in the exam.
Amit
Hi,
You have decleared the class constractor out side the class, that's why you are getting the error message at compile time.
Remove the extra '}' before the class constractor and compile your code again it will work.
Good luck
Amit
public class test{
static String f()
{
String s="hello";
String b="bye"; //1
String c=b+"i";
String d=b;
b=a; //2
d=a; //3
return c; //4
}
public static void main(String s[])
{String msg=f();
System.out.println(msg); // 5
}
}
First of all this program will not at all compile bcoz variable a is not declared.
Now if we assume that a is also a String varaible then object b will be available for garbage collection after line marked with //3, since "bye" is not referenced after d has the reference of object a.
Hope this help.
When sleep() did'nt releases the lock then how come 'C' is the correct answer?