Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

payal bansal

Greenhorn
+ Follow
since May 01, 2001
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 payal bansal

Thanks for your reply Mohammad. i do have a experience in programming. But i do want to prepare myself for developer exam. I want to know the proper channel for this as which book and which are the best sites for this. thanks in advance.
Hi all!
I am new to this discussion form. Have just cleared SCJP and now do want to prepare for Developer examination. Please give me some guidelines, as how to proceed. Thanks in advance!!!
Hi Poonam!
Soory for delay. Mock exams form Jtips.net, joppa.appliedreasoning.com, go4java.20m.com and Jwaroski are quite tough as compared to real exam. And i got 6 to 7 questions from each i/o and Thread topic. Best of luck for your exam!!!
19 years ago
First of all, I do want to thank all the members of JAVARanch. This site helps me a lot in getting good score. Now, i do want to prepare for developer exam. Please, give me some guidance for this. And one thing more, i would like to add is-- questions in real exam are pretty easy as compared to some tough mock exams!!!Once again, i thank JAVARANCH for providing such a great support to all preparing for SCJP!!!
19 years ago
Someone please solve the problem. Its very urgent as i am going to appear for SCJP tomorrow.
Someone please help me!!!
accordind to my opinion, from exam point of view, its a keyword
So, which option should I opt?? more comments needed.
Please, someone solve my problem. As i am appearing for SCJP on 31 July. Thanks all!!
Hi Sandeep,
thanks for your reply. But i don't understand one line in your reply. Whad do you mean by this?---just an enter in "info.txt" would represent '\n' in the file.
and in java api of PrintStream class its written--a PrintStream can be created so as to flush automatically; this means that the flush method is automatically invoked after a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written.
In first case, we are invoking write() method with '6' , not with '\n'. Then why this o/p?
and in second case, just by presing enter, how the flush() gets invoked? Its clearly written in API, autoflush should be enabled, and one of the above conditions should be met, then only, it gets written.
Do tell me the one right ans as i am appearing for SCJP on 31 july. Thanks all!
Hi all!
As i am appearing for SCJP on 31st of july, do reply me as soon as possible.
int b = 'A';
System.out.write(b)----->this question is from some mock exam. Now i don't remeber form which mock exam this question is.
Its ans is given as----This will not print anything until we call explicitly its flush() or close() method or flush the buffer by calling write('/n'). But when i execute this program, i am getting the input, without using any of the above methods. Can anybody tell me the reason???
Same is the case, when i am making an instance of PrintStream class.
try{ FileOutputStream f1 = new FileOutputStream("info.txt");
PrintStream p = new PrintStream(f1,false);
p.write('6');
p.write('8');}
catch(IOException e){}------->Even in the constructor, i am explicitly disabling the autoflush, then even in the file --"info.txt" 6 and 8 gets written.
As System.out is an instance of PrintStream class, why
am i getting this type of output???
Thanks in advance
Hi all!
Is this a correct statement??? Object's lock acquired by a thread can be released by wait() and yield() method(). and sleep() can not release the lock.
Hi all!
I do want to know answers of my two questions. Thanks in advance.
1.... public class Q131
{
static int call(int x)
{

try{
return 1;
}
line 16. catch(IOException e)
{
return 2;
}

}
public static void main(String[] args)
{
call(5);
}
} ........>as we compile this, we get a compile error----Exception java.io.IOException is never thrown in the body of the corresponding try statement.
as this is checked Exception, so we get a compile time error. but if i replace the line 16 with catch(Exception e)----> we don't get a compile time error. Why???. Because as per my knowledge, Exception is also considered as a checked exception in java.
2......import java.io.*;
public class Q13
{
static int call(int x) throws IOException
{
try
{
System.out.println(x---x/0);
return x--;
}
catch(Exception e)
{
throw new IOException();
// return x--;
}
finally
{
return x--;
}
}
public static void main(String[] args) throws IOException
{
call(5);
}
} ----> when we run this program, it runs fine. Why???Why don't it throws an exception at run time? but if we replace return type of call method with void, then it throws the exception.
hi all!
class A{
int a = 10;
int b = a*c;
int c = 10;
}----->it gives compile time error, as we cant make forward referencing. But i have some confusion......
When we create an object, then first its instance variables are initialized to their default values, then super class constructor is invoked and then instance initializers or expressions are evaluated and then its own consructor gets invoked. if this is the case, then a,b,c are initially initialized to 0,0,0. Then at the time of execution of initializer expression, why do we get compile error? Do reply me at the earliest. Thanks in advance.