Venkat KG

Greenhorn
+ Follow
since Nov 13, 2005
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 Venkat KG

Hi,

In this
4*6-3/2<<2*5>>>1%2-4^3;

Arithmetic operators is given high priority.

So
Step1: 23<<10>>>-3^3
Step2: 2352>>>-3^3
Step3: 0^3
Step4: 3

Hence the result is 3.

Regards,
Venkat
Hi,

Can any one help out in this prog.I really cud not undersatnd what is happening in Line 1 and Line 2 .Why the o/p is printing as 122.

public static void main(String argv[]){
Test1 td = new Test1();
td.samcov();
}
public void samcov(){
int i=1;
int j=2;
if((i==20) && (j==(i=i*2))){ //Line1
}

System.out.print(i);
if((i==20) & (j==(i=i*2))){} // Line 2
System.out.print(i);

int x = i & 2;
System.out.print(x);
}


}
Hi ,

Accroding to this

Say X=8 ; If you perform Y = X++;
Then Y=8; and X=9;

If you perform Y = ++X;
Then Y=9; and X=9;

If you perform Y = X--;
Then Y=8; and X=7;

If you perform Y = --X;
Then Y=7 and X =7;


Hope this helps

Regards,
Venkat
Hi Ashok,


In General, Assertions are enabled only if you turn on it explicitly.By default they are not enable.

Use '-ea' to enable assertions.

Regards,
Venkat
Hi,

Just need to know after intern() how many no of objects will exists
Yes Correct

I guess it gives 1 as output.


Correct me if am wrong
Yes Correct

I guess it gives 1 as output.


Correct me if am wrong
Hi Guys,

Have doubt ...need clarification

String one = new String("someString");
String two = new String("someString");
two.intern();

How many objects will be created for this..

What is the use of intern() method ? Can any one expalin in detail

Regards,
Venkat
Hi ,

I have doubt in the below program.In this case what will happen.


class Vararg {
static void vararg(long... x)
{ System.out.println("long..."); }
static void vararg(Integer... x)
{ System.out.println("Integer..."); }
public static void main(String [] args)
{
int i = 10;
vararg(i,i);

}
}


Thanks in Advace

Regards,
Venkat