rohit kumar

Greenhorn
+ Follow
since May 27, 2007
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 rohit kumar

Q. Consider the following code fragment:
public class AssertionExample2 {
public static void main(String[] args) {
System.out.println(args.length);
assert args.length != 0;
}
}
Which of the following must be done in order for the code to throw an AssertionError?
(Choose all that apply.)
A. The code must be compiled with the -source 1.4 option if you are using JDK 5.0.
B. The program must be executed with the -ea option.
C. At least one argument must be given in the execution command.
D. No argument should be given in the execution command.

i tried compiling without source option its giving me results like 0 which is expected but compiling with source option also happens to provide me with the same answer which makes things confusing.

Can we overload constructors in anonymous classes? Also can we override the default no-arg constructors? If yes, pls explain with an example.
Is there any way I can invoke sizzle() on an anonymous subclass of Popcorn?


Hi ranchers I am getting error like nextToken() method providing incompatible types while working with TT_WORD - even readToken() method in place of tokenizer.nextToken() dont seem to work as well. What's the way out?

I am getting a runtime error. PLs help
thanks ranchers I missed out that 2.0 is a double so the entire exp evaluates to adouble
This is an excerpt from "Begining Java 5" Wrox by Ivor Horton

"Method Function Argument Type Result Type
round(arg) calculates the nearest float or double of type int for
integer to the argument a float argument.
value. of type long
for a double
argument


the expression to the right of averageFruit1 should not be explicily casted according to the author but the compiler shows me error "possible loss of precision" Is it a typographical error in the book
N.B. the problem gets sorted out with the following explicit casting:

expecting a quick response from ranchers as has always been your USP!!!
Why factory methods have been defined as separate set of methods?

We can directly access superclass objects from subclass reference so what's the point in typecasting it?
just wanna clarification - is it true that stub is the client side EJB proxy and skeleton is the server side EJB proxy or they both refer to the server itself
Suppose I have a Account Bean, its remote interface Account, its home interface AccountHome and the primary key class AccountPK - why is it I have to have a primary key class separately in Bean Managed Persistence can't I have it done from the home interface itself or the ejb object - is it because of the inherent problems associated with BMP and that is the reason why all these overheads of primary key generator class is done by the container IN CMP?
[ June 22, 2007: Message edited by: neo trinity ]