madhu raina

+ Follow
since Oct 29, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by madhu raina

class Test {
static int a=5;
static int b=a;

this.a = ++a;
public static void main(String[] args) {
System.out.println( a + b );
Prints 11. True or False?
Given the following class definition in a file named,


public class MyClass{
int i;
public void amethod(){

i = 10;
throw new IOException();
catch( IOException e){
System.out.println("i is : "+i);
} //end of amethod()

public static void main(String[] args){
MyClass mc = new MyClass();
} //end of main
} //end of class MyClass
What happens when we try to compile and run
A.Code does't compile because of error Statement not
B.Code doesn't compiles because IOException cann't be
thrown explicitly
C.Code compiles & runs with output
i is : 11
D.Code compiles & runs with no output.

not sure of answer pls explain
Given the code, what is the output
public class MyClass{
static int i = 10;

public static void main(String[] arg){
static int i = 20;
System.out.println("i is :"+i);
A.Code Does't Compile.
B.Code Compiles but error will be generated at runtime.
C.Code Compiles & runs, output is
i is : 10
D.Code compiles & runs, output is
i is : 20
pls explain
Question 4.
To increase size of a button in a Frame with GridBag Layout manager as its Layout manager, which of the following best describes what you do.

A.We can't do any thing like this irrespective of the layout
policy of the container.
B.Use setFill method of GridBagLayout class.
C.Use setFill method of GridBagConstraints class
D.Use fill() method of GridBagLayout class.

The correct answer given is D but i think it is wrong!
pls explain
thanx a lot in advance
How many String objects are created when we run the following code.
String s1,s2,s3,s4;
s1 = "Hello";
s2 = s1;
s3 = s2 + "Pal";
s4 = s3;
i think 2, but the mock exam answer says 3 pls explain.
Thanx in advance
pleaz let me know inif this class declaration is invalid
public myclass extends Object
weighty feild in case of the gridbagconstraints class specifies the distribution of extra horizontal space of a component,but there is one question in the book Khalid Mughal's sample test where it says that it specifies the extra vertical space distribution of a component pleaz help i m confused,but i still think that answer in book is wrong.
Can u pleaz tell me tthat wether we can use this key word with the static variables.
Can u pleaz let me know about more in detail regarding the type of questions aksed in Sun exam about util & lang Package.