kavita desai

Greenhorn
+ Follow
since Jul 09, 2001
Merit badge: grant badges
For More
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 kavita desai

thanx a lot all of u. the concept is clear now.
kavita desai
Hi, this 2 questions are from www.go4java.20m.com mockexam 1. Q.13 my problem is how can an instance created with a null value ends up calling the constructer that takes string as parameter.
Q.14 just fail to understand
please help.
kavita desai
Q13.What will be the result of compiling and running the given program?
Select one correct answer.
1 class sample
2 {
3 sample(String s)
4 {
5 System.out.println("String");
6 }
7 sample(Object o)
8 {
9 System.out.println("Object");
10 }
11 }
12 class constructor
13 {
14 public static void main(String arg[])
15 {
16 sample s1=new sample(null);
17 }
18 }
ans: Program compiles correctly and prints "string" when executed.
--------------------------------------------------------------------------------
Q14.What will be the result of compiling and running the given program?
Select one correct answer.
1 class sample
2 {
3 sample(String s)
4 {
5 System.out.println("String");
6 }
7 sample(StringBuffer sb)
8 {
9 System.out.println("StringBuffer");
10 }
11 }
12 class constructor
13 {
14 public static void main(String arg[])
15 {
16 sample s1=new sample(null);
17 }
18 }
ans: Compile time error as call to constructor at line no. 16 is ambigious.
d is false because u cannot use equals() to compare 2 non realted classes. but if u do, there is no error it simply returns false.
hope that helps
kavita desai
Hi Maple,
i had come across the same question in JohnHunt mock exam. the answer is B that is red but i think it is blue. what according to u is the correct ans?
kavita desai
Hi,
that's exactly where i am confused too, kindly help.
kavita desai
it is rather class without a name. the comiler supplies all the necessary code. If we go by the example of anonymous class given by Manfred...in line 3, the anonymous class is created which extends Object and implements ActionListener. The compiler creates a class file for the anonymous class with the name... (supposing the name of the enclosing class is Outer) Outer$1.class.
please correct me if i am wrong,
kavita desai
Hi, this is java's original 'outward rippling' event model which is replaced by 'event delegation'. as i found the coding for old model difficult to understand, i have comletely skipped it. :-( is it necessary to learn it for the scjp exam?
Thanks a lot Manfred.
Hi Jordi,
you can have various inner classes. Anonymous Inner class is one of them.
1. member inner class. which a class inside a class with a name but not same as the enclosing class
2. local inner class. class inside a method, has a name.
3. anonymous inner class. does not have a name, used widely in connection with event handling.
4. you can also have an interface inside a class.
hope that explains,
kavita desai
Hi,
this question is from poddar's mock exam. my problem is with regards to f7, why should a float be rounded off to minimum value allowed for an Integer? what has float to do with that?
Q26. Given Integer.MIN_VALUE = -2147483648 Integer.MAX_VALUE = 2147483647 What is the output of following
{ float f4 = Integer.MIN_VALUE;
float f5 = Integer.MAX_VALUE;
float f7 = -2147483655f;
System.out.println("Round f4 is " + Math.round(f4));
System.out.println("Round f5 is " + Math.round(f5));
System.out.println("Round f7 is " + Math.round(f7));
}
a)Round f4 is -2147483648 Round f5 is 2147483647 Round f7 is -2147483648
b)Round f4 is -2147483648 Round f5 is 2147483647 Round f7 is -2147483655
correct ans: a)
thanking in advance,
Kavita desai
Thanks a lot ashish and guoqiao.
Hi, my question is from poddar's mock exam. isn't Math.round(f6) supposed to return -6?
{ float f4 = -5.5f;
float f5 = 5.5f;
float f6 = -5.49f;
float f7 = 5.49f;
System.out.println("Round f4 is " + Math.round(f4));
System.out.println("Round f5 is " +Math.round(f5));
System.out.println("Round f6 is " + Math.round(f6));
System.out.println("Round f7 is " + Math.round(f7)); }
ans: Round f4 is -5 Round f5 is 6 Round f6 is -5 Round f7 is 5
i am trying to get my applet servlet communication to work on AS400 WebSphere Application server (3.5EE).
where do i change the properties if any to make it work. also which properties should i configure.
thanks.
21 years ago
Hi Tamanna,
it does not matter if class Vis extends Base or not. any class that is not inside another class is called a top level class and a top level class cannot be private or protected. it can only be either public or default.
all the best
Kavita.
Manfred, Dave and Scott, Thanks a lot. this was my first experience at javaranch saloon and found it very helpful thanx again.
kavita desai