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

pravin kumar

Ranch Hand
+ Follow
since Nov 03, 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 pravin kumar

There is method of allocate new employee to perticular task.
To allocate a new employee..have to click on the allocate label..which in terms
pop-up the new window with list of employees
now,based on the seleted employee with selection of the radio button
on the new pop- up window,respective name have to populate in the text field of the parent window.
please kindly help me on this..any pointer is appreciated
Anyone know about the exam centres in united kingdom
Strictly speaking as long as there is no reference ..you could say that object is eligible to gc but still island of isolated objects are the exceptions for it
so i think answer should be false ..as because of above reason
Please correct if am wrong
well probably it may sounds stubborn but i just want to know how come value of the i=1 here in the example


Integer wiNumber = new Integer(argv[0]);
int i = wiNumber.intValue();/// here
Integer wiNumber = new Integer(argv[0]);

what is value of wiNumber here?
public class Lukeg{
public static void main(String argv[]){
Lukeg lg = new Lukeg();
lg.go(argv);
}
public void go(String[] argv){
Integer wiNumber = new Integer(argv[0]);
int i = wiNumber.intValue();/// here
i = i * 2;
System.out.println(i);

}
}

[b]In above code how come value of i (in bold i) becomes 1 which in results in 2 as final output
What will happen when you attempt to compile and run the following code?

import java.util.*;
public class SortList{
public static void main(String argv[]){
new SortList();
}
SortList(){
ArrayList<String> al = new ArrayList<String>();
al.add("z");
al.add("b");
al.add("c");
Collections.sort(al);
for(String element : al){
System.out.print(element);
}
}
}


Answer is dcz ..please explain
public static void main(String[] args)
{
String s ="Hello";
String t = s.toLowerCase().intern();
String u = s.toLowerCase().intern();
if( t == u)
System.out.println("equals");
else
System.out.println("false");
}
}
here as i know when u use '=='--it will return true if the both string references refer to same object
as in above code t and 'u' are two different object references
so after using 'intern()' method..does it make 't' and 'u' to refer to the same object as "t==u" returns true
Please guide on it
According to me..it is more or less similar to the real time sun test
so i guess it's a nice score
BTW..from where did u download the exam..please send the site name for other racher's too
thnaks ..
best of luck
import java.io.IOException;
public class ExceptionTest{
public static void main (String[]args)
{
try {
methodA();
}
catch (Exception e) //compilation error here
{
system.out.println("Caught Exception");
}
}

public static void methodA ()throws IOException{
throw new IOException ();
}
}

here we throw IOException in the methodA..
so according to my understanding ..as u throw IOException in the method i.e. u declared the exception throwed in the method ..the same should not catched in try-catch block.
[b] please explain the same
hey i heard either you could declare or catch the exception
so it should not compile as
method() method throw exception and also catch the same in try-catch block
please explain
public class Test {
public static String output ="";

public static String foo(int i) {
try{
if(i==1) {
throw new Exception();
}
output += "1";
}
catch(Exception e) {
output += "2";
return output;
}

finally {
output += "3";
}
output += "4";
//return output;
}
public static void main(String args[]) {
foo(1);
System.out.println("The output after foo(1) is:"+output);
}
}


here code goes go catch block..i just wanted to know tht can't we put
return statement in catch block rather than after finally


Please sorry if it is inane question
i guess..it's regarding all possible input parameters to the switch statement which are int,short,byte,char
public class BettyAck {
public static void main(String argv[]){
BettyAck b =new BettyAck();
}
public BettyAck() {
Integer x = new Integer(10);
findOut(x);
Integer y = new Integer(99);
Integer z = y;
z = null;
findOut(y);
//here
}
public void findOut(Integer y){
y = null;

}
}

how many objects are garbage collected..ans=0..please explain
thnks for the both reply