Win a copy of Spring Boot in Practice this week in the Spring forum!

Alk

Greenhorn
+ Follow
since Feb 02, 2000
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 Alk

GC
hi
What I mean here is:
DO WE NEED TO EXPLICITLY MAKE THEM "NULL", TO MAKE THEM ELIGIBLE FOR GARBAGE COLLECTION
I know they will be garbage collected after the method exit the scope
ALk
GC
HI
Do we need to make the variables defined in the method scope, explicitly null,to make them eligible for GC?
Which of the following statements is valid?
A.The JVM runs till the main method exits, even if there are other user threads running.
B.An InterruptedException occurs when the sleep() method is called on a thread.
C.A thread can be suspended for an indefinite duration of time.
D.A thread can be made in Java only by subclassing the Thread class.
E.The synchronize keyword can be used only in a method that is part of a class that is derived from Thread.
I think the correct answers are B) and c)
Any Suggestions?
Alk
Choose the correct statement about gridbag layout:

A.The weightx & weighty should have values between 0.0 & 1.0
B.If you specify the fill field is BOTH, there is no meaning to set anchor field
C.If you specify anchor field there is no meaning to set fill field is BOTH
I think all the options are correct( Am i right?)
Choose correct declarations of two dimensional String array
A.String[][] a = String[20][20]
B.String[][] a = new String[20,20]
C.String[][] a = new String[20][20]
D.String a[][] = new String[20][20]
E.String[] a[] = new String[20]20]
You are Right!!
Alk
What is the result of attempting to compile and run the following class?
class Ar {
public static void main(String[] args) {
int[] seeds = new int[3];
for (int i = 0; i < seeds.length;
i++)
System.out.println(i); }
}
Select all valid answers.
a.0
b.1
c.2
d.3
e.the program does not compile because the seeds array is not initialized
I though the answers is a) but the correct answers given are a) b) and c)
Int
So,
ceil(-0.4) will be -0.0 and not 0.0, am I right , Tony?
Int
Do we have 0.0 and -0.0 as two different in java?
The answers are:
50)B and D
56)C
60)D
Explanations:
50)The question is to draw a rectangle with a single method call so e) is wrong.
56)repaint(),update(),paint() is the correct sequence.
60)raf.seek( raf.length() );
This will put the file pointer after the last charcter of the file.
Alk
You are missing something(A Question)
Alk
Comment on this:
An Anonymous call is ALWAYS assumed to extend Object class.
What will be the result of runnig the following with the input of 67?
public int MaskOff ( int N){
return N | 3;
}
Can you please explaing What is MaskOff in java, I never came accross it.
Thanks in advance
Alkesh
class Base {}
class Sub extends Base {}
class Sub2 extends Base {}
public class CEx{
public static void main(String argv[]){
Base b=new Base();
Sub s=(Sub) b;
}
}
this gives run time error, Sub is subclass of
Base,would this work
if any instance of Base can receive the value of
Sub but not vice versa,is this only possible for
widening conversion for primitives?
hi
if u reverce the sign for as >30 to <30 then u will get the required answer.