Chaitali Deshpande

Greenhorn
+ Follow
since Jan 17, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chaitali Deshpande

I passed certification exam with 86% on 1/3/2001.
I would like to thank all at javaranch.
Thanks to all who used to give prompt answers to my queries.
Last but not the least I would like to thank Velmurugan Periasamy
for creating good set of notes.He has put in lot of effort in
creating and organizing the notes in systematic manner.
To all aspiring SCJP:-
On the scale 1-10 I found level of toughness of the exam to be 7.
I know i am not writting anything different but practising as many mock exams as possible increases the confidence level.Make use of this excellent site(javaranch) to clear all ur doubts.
Sometimes I have asked silly questions and I have received serious replies but it has helped me to clear my doubts.
Best Of Luck
Chaitali
23 years ago
greg
I think A is a hexadecimal digit
greg
I gave them in single post because both question are related.
Question 27.
public class ADirtyOne
{
char a = '\u000A';
}
An attempt to compile the above class
1) will complete successfully.
2)will not compile as 0x000A is out of range for unicode charaters.
3)will complain about illegal character assignment
4) will compile but will cause a runtime error in accessing the variable.
Ans 3
Can someone please explain why 3?
Thanks in advance

The following code is for Questions 81 and 82

//Contents of File AnInterface.java
public interface AnInterface
{
public void methodOne() throws Exception;
}

//Contents of File AnInterfaceImpl.java
public class AnInterfaceImpl implements AnInterface
{
public void methodOne()
{
System.out.println("I will never throw an exception");
}
}
Question 81.
Read the code below carefully.
public class ATest
{
public static void main(String args[])
{
AnInterface ai = new AnInterfaceImpl();
ai.methodOne();
}
}
Attempting to compile and run the above code
1) Will cause a compile time error. (Line 5 : Exception must be caught or thrown by main(String))
2) Will cause a compile time error for Class AnInterfaceImpl. The method methodOne() be declared with "throws Exception".
3) Will cause no compile time error and print "I will never throw and Exception the screen".
Will Cause a run time error .
-----------------------------------------------------------------
Question 82.
Read the code below carefully.
public class ATest
{
public static void main(String args[])
{
AnInterfaceImpl ai = new AnInterfaceImpl();
ai.methodOne();
}
}
Attempting to compile and run the above code
1) Will cause a compile time error. (Line 5 : Exception must be caught or thrown by main(String))
2) Will cause a compile time error for Class AnInterfaceImpl. The method methodOne() be declared with "throws Exception".
3) Will cause no compile time error and print "I will never throw and Exception the screen".
Will Cause a run time error .

Ans 81)1
82)3
Can someone please explain me the output.
Thanks in advance.
Thanks Lisa
I overlooked the funda.
from velmurugan's notes
public class Precedence{
final public static void main(String args[])
{
int i=0;
i=i++;
i=i++;
System.out.println(i);
}
}
o/p is 0
velmurugan's explanation is "=" has lowest precedence.
my question - even if values is not assigned ,value is incremented with"++" operator so why 0
Manfread
I tried the program by nan.
if i replace
File f = new File("c:\\book\\chapter1"); with
File f = new File("c:\book\chapter1");
it gives me a compiler error ,does it mean on windows we
have to use "\\" instead "\".
Chaitali
Thanks to all for ur suggestions.
Shailesh ur suggestion was definetly helpful,Rahul Mahindrakar
has really done a good job.
Thanks Sandeep ,the site is very useful one.
1)Can someone please suggest me site of mock exam that
has more emphasis on threads questions
2)I find my weak area is threads ,can someone suggest how i go
about improving the same.
Thanks in advance.
Thanks Val Dra for ur reply but my query has not been resolved
does == sign also check contents of string
from marcus mock exam#1
Given the following code, what test would you need to put in place of the comment line?
//place test here
to result in an output of
Equal
public class EqTest{
public static void main(String argv[]){
EqTest e=new EqTest();
}
EqTest(){
String s="Java";
String s2="java";
//place test here {
System.out.println("Equal");
}else
{
System.out.println("Not equal");
}
}
}
1) if(s==s2)
2) if(s.equals(s2)
3) if(s.equalsIgnoreCase(s2))
4)if(s.noCaseMatch(s2))
If i use if(s==s2) i get o/p as Not Equal
my query is, == operator checks the memory reference so the
o/p should be Equals.
Does it mean that it also checks the value in strings
or is there any other explanation.
Thanks in advance
Thanks Val Dra and thanks for ur explanation Jane
chaitali
From khalid's mock exam
Given:-
interface I{
void setValue(int val);
int getValue();
}
Definition a:
abstract class C implements I{
int getValue(){return 0;}
abstract vid increment();
}

Can we create class c using interface I
I feel we can create because class c is defined abstract.
Am I right
I tried installing khalid's applet i get following message
on command prompt
failed to load main class manifest attribute from
pgjc-engine.jar
any solution
Thanks in advance