MSanjeevMehra

Greenhorn
+ Follow
since Sep 18, 2003
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 MSanjeevMehra

c)

e)

e) if you will run this with over-reidden equals() method, it will return true else it will return false.
hope this will help.
[ October 02, 2003: Message edited by: MSanjeevMehra ]
Sorry dear, i am not able to ans. ur question. but ur display name is not according to naming policy of javaranch. so visit the foolowing link
naming policy
and also u r no allowed to post multiple thread of same ques. so pls. correct ur display name. well u will get a mail from moderaters of this forum also.
20 years ago
--------------------------------------------------------------------------
What level of operator preceedence we have to memorize for exam? I understand for real world we will use paranthesis...
--------------------------------------------------------------------------
i don't the ans of above statement.
but here we don't need to remember precedence

x += condition ?if_true :if_false
where is ambiguity. pls. correct me if am wrong.
i don't url of kathy's mock test; but try free available mock exams on net and learn from ur mistakes. i read from khlid mughal and take free avaialable mock and was able to pass final exam.
both, scjp book (teach java topics required in test) and mock tests(tell u ur mistaks) r imp.
you are correct.
I recall reading that range of char is from 0 to 65535.
Someone correct me if I'm totally in the woods here.
[ September 25, 2003: Message edited by: MSanjeevMehra ]
visit any ssi/niit/aptech center. they will give you tel# & address of their testing center.
I meant, they conduct exam for sun certificatios.
[ September 25, 2003: Message edited by: MSanjeevMehra ]
see hashcode() in Object class.
hashcode()
hashCode
public int hashCode()Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.
The general contract of hashCode is:
Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Returns:
a hash code value for this object.
[ September 25, 2003: Message edited by: MSanjeevMehra ]
u mentioned that it works on desktop.
but does not woks at ur taptop. so possible reasons could be :
java is case sensitive language. ur class name must match to ur file anme and java command.
1.class Grades
{
}
2.save as Grades.java
3.to run programme
java Grades
20 years ago
if u can write code which refreshes 2nd clients gui, u r free to implement that. but as mentioned in sun instruction it is not necessary.
servletconfig helps to handle servlet.
servletContext helps to handle web application.
link
[ September 24, 2003: Message edited by: MSanjeevMehra ]
20 years ago
-------------------------------------------------------------------------
a Hexadecimal literals is allowed up to 16 digits, not including the prefix 0x or the optional suffic extension L. What does that reall mean?
--------------------------------------------------------------------------
max limit of hax literal 0x7fffffffffffffff (0x 16 digits)

-------------------------------------------------------------------------
int y = 0x00000000000000001; // compiled OK, although there are 17 digits
-------------------------------------------------------------------------
max limit of int data type is 0x7fffffff;
when u write it as
int y2 = 0x7fffffff; // works, max value for int (with in range).
int y = 0x00000000000000001; // works, value with in range.
int y3 = 0x7fffffff1; // does not work, value out of range.
00010 < 100 (5 digit no is smaller than 3 digit)
int i = 0x000000000000000000000000000000000000000000000000000007fffffff;
int ii = 0x7fffffff;
i == ii == max limit of int dtat type.
-----------------------------------------------------------------------
long x = 0xaaaaaaaaaaa; // does not compile, although there are only 13 digits.
-----------------------------------------------------------------------
default data type of interger value is int with max limit 0x7fffffff
and 0xaaaaaaaaaaa excced the limit of int data type. 0x7fffffffffffffffL or 0xaaaaaaaaaaaL is treated as long.
long x = 0xaaaaaaaaaaaL; is valid.
[ September 23, 2003: Message edited by: MSanjeevMehra ]
hi,
u r right, object declared as fianl can not be referenced to other or new object. ie. when u concatinate two strings, it creats new object. but when u append StringBuffer, it changes object's state.
easy eg. to understand it would be
class ABC
{
String str;
ABC(String str)
{
this.str=str;
}
}
class XYZ
{
final ABC obj1 = new ABC("Hello");
ABC obj2 = new ABC("Hi");

obj1 = obj2; // will not work, because obj1 is declared as final and value of ref., obj1, cannot be changed.
obj1.str = "Hi"; // will work, because u r not changing ref. but state (value of obj1's property).
}
20 years ago
pls. visit following link
link

it contains
-Xquickstart: You can use this value for initial compilation at a lower optimization level than in default mode, and later, depending on sampling results, you can recompile to the level of the initial compile in default mode. Use quickstart for applications where early moderate speed is more important than longrun throughput. In some debug scenarios, test harnesses and short-running tools, it is possible to realize startup time gains between 15-20%. -DCOPT_NQREACHDEF can improve startup by an additional 15%.
[ September 22, 2003: Message edited by: MSanjeevMehra ]
[ edited to fix the posted link -ds ]
[ October 02, 2003: Message edited by: Dirk Schreckmann ]
20 years ago
i am not sure weather we can set default gc thread�s priority or not. but u can use System.gc() for garbage collection or can create a thread with System.gc() statement and set priority of that thread.
20 years ago
----------------------------------------------------------------------------
string binary = "10000010111101010001101100000010";
----------------------------------------------------------------------------
needs JDK1.4 for matches("") method.
binary.matches("01"); returns true if binary contains 0 or/and 1; else false.
[ September 22, 2003: Message edited by: MSanjeevMehra ]
20 years ago