Rajni Singh

Greenhorn
+ Follow
since Dec 05, 2000
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 Rajni Singh

Congratulations Jay !
What type of questions were there on threads and IO ?
Rajni
23 years ago
Hi Friends !
I am appearing for certification on 19th Dec....I do not have confidence in IO at all...could you please tell me where to study this topic from and what type of questions come in IO ?
Thanx
Rajni
Sahir, will you please be more specific as to what causes the stack overflow ?
Michael, could you tell us the error please ?
Hi !
In line 2, when the method giveMeJ() is called, the variable j has not been initialised to 10. However the complier using the lookup table knows that a variable called as j exists. since j is a class variable, it is assigned default 0 value. Hence the method returns 0.
Hope I am clear.
Also there is a typing mistake in ur code. You should be creating an instance of class Test and not class AQuestion in the main method !
public class check
{
public class myabstract
{
int i;
String s;
private void mymethod()
{
System.out.println("In myabstract::mymethod()");
}
public void anothermethod()
{
System.out.println("In myabstract::anothermethod()");
}
class myinner extends myabstract
{
private void mymethod()
{
System.out.println("In myinner::mymethod()");
}
}
}
}

Hi Aparna !
A private method is not inherited by a subclass under any circumstance. Well, what you are doing is not overriding the method mymethod() in class myinner but creating an entirely new method in myinner as the super class method mymethod() is not inherited by myinner class at all.
Also aprivate method cannot be declared abstract as a private method is not inherited by a subclass whereas an abstract method
requires to be overridden in the subclass. Hence using both private and abstract modifiers is contradictory.
Hope I am clear.
file.seek(5) sets the file pointer offset just after 5th posn measured from the beginning of this file. The next read occurs from the new position, hence the answer is (b) .
Sorry guys...
and thanx a ton for telling me the right fact !
The division opeartion results in ArithmeticException being thrown. However, its an unchecked exception, so the java runtime system handles the exception itself and returns -1.
So -1 is printed.