Win a copy of Rust Web Development this week in the Other Languages forum!

usha prithvi

Ranch Hand
+ Follow
since Jun 22, 2005
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 usha prithvi

Hi Deepa,

I am in US itself.Hope I will get the certification soon. I was wondering how will the SUN logo be useful?How can one use it?

Thankz
16 years ago
Hi Guys,

I passes the test. I am happy to be a Sun certified java programmer. Thankz for all of you who have answered my doubts in java.

For those people, who are yet to give there test, I suggest you do as many mock tests as possible. Dan's, majji,abhilash quiz,marcus n K&M tests are worth doing. If you can do all the tests listed in the javaranch exam list. Concentrate on Inner classes,Assertions and threads.

I would like to know how to get original certificate from Sun? Should i register in certmanager to get the certificate? how long is it going to take to get my certificate?

Thankz
16 years ago
Can someone explain why doesn't the code reach in the if block

Thankz
[ July 26, 2005: Message edited by: Barry Gaunt ]
Hi,

Code fragment is as below.......
int x =5;
int y = x++;
System.out.println(x);
System.out.println(y);

Now, the output is x = 6, y = 5. I agree with the result. Now, if the variable y is replaced by x, then the code ......

int x =5;
x = x++;
System.out.println(x);

the output to the code gives 5. But i think the value of x should be 6.Why is the output 5. can someone explain the second scenario?

Thankz
Hi Barry,

From the link provided I understood that char A = '\u000A'; gives compiler error. But in the code written //char A = '\u000A; the line should be ignored since // is present. Still, why does the compiler shows an error? PLease explain.

Thankz
[ July 14, 2005: Message edited by: usha prithvi ]
I am glad to get replies from great guys like u.
Thankz
Hi,

this is question 28 from Abhilash java quiz

public class ADirtyOne
{
//char a = '\u000A';
}
An attempt to compile the above class
1.will complete successfully.
2.will compile sucessfully but with a warning message.
3.will not compile - complains on an invalid expression.

I think the answer is 1.But the given answer is 3. I tried to compile the code, and itz showing the error.When // used for commenting, it comments the entire statement next to it right? Then why is the compiler showing the errror?

Thankz for the reply.
hi,

In the below code, why doesn't the compiler show casting error?Instead itz compiling without error.Can you explain why? public class One
{
private final int i =10;
private byte k = i;
}
Here int value is assigned to byte.Then compiler should say type mismatch.right?Please correct me!

Thankz
I am sorry.Itz and. What is the difference between == and equals? how does it work in Strings? Thankz
16 years ago
hi,

Please explain the difference between == n equal? n how it works in Strings?

Thankz
16 years ago
Hi,

can someone explain difference between stack n heap with examples? and when does stack n heap get used internally?

Thankz
quote:

An interface can only contain method and not variables

I dont think so. An interface can have method declarations.Along with that it can have variables but of type public,final,static r default. let me know if i am wrong.

Thankz

public interface intf2 {
public void dis();
int dis1();
abstract int p();
final int i = 10 ;
static int j =20;
int k =23;
}
Thankz for the explanation!
hi,

have a look at the below code......

class A{
Static void main(String args[]){

byte b1 = 33;
b1++;
byte b2 = 55;
b2 = b1 + 1;// 1
System.out.println(b1 + " " +b2);
}
}

In the above code compilation error is occuring at line 1. Says cant cast from int to byte. I know that byte values range from -128 to 127. Then why b1 value is not accepted as byte.what is the error? am i missing any point in casting.please explain.

Thankz
hi,

One of the question from a mock test of examguide online is ..........

class C {

public static void main (String[] a1) {

System.out.print(a1[1] + a1[2] + a1[3]);

}}

What is the result of attempting to compile and run the program?


java command A B C

1.Prints: ABC

2.Prints BC and Runtime Exception

3.Prints: BCD

4.Runtime Exception

5.None of the above


The given answer for this Answer 2(array index outof bounds exception only till a1[2] is allowed.)
but I think the answer for this 4.runtime exception. when i tried to execute array out of bound exception has arrivied, with no output as BC. So how can one justify the answer to be no.2? please explain.