kirti tiwari

Greenhorn
+ Follow
since Feb 04, 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 kirti tiwari

Hi Everybody,

I just passed SCJP 1.4 this morning with 86% marks.

Wanted to share my preparation steps-

>Only K & B is sufficient for the exam preparation.it is a very good book.
>Read this book atleast twice.

>Make notes of important points and keep going thro' them so that they remain in your mind.

>Give proper time to get through 2-minutes drill after each chapter.

>Go through Exam watch points in between chapters. Try to keep them in mind.

>Go throygh the sites as-

*Marcus green mok test
*Dan topicwise questions
*Round up game at javaranch(As starting of mock exams)
*exforsys.com
*javaprepare.com
*Khalid Mughal mock test
*Keep looking questions posted on forum and try to solve them

>Atleast study 2-2.5 months seriously..if you know litttle of java and not working on java as your primary skill.

>i scored 70-72% in marcus green, 80% on K&B masters exam.

Lastly....try to code more and more. It actually makes things more clear.

All the best to all SCJP 1.4 Aspirants.

Good Luck!!!

~Kirti
17 years ago
Hi Everybody,

Today i cleard SCJP 1.4 with 86% marks.

I want to thank all Ranchers for their prompt replies that helped me making my concepts strong.

Regards
Kirti
17 years ago
Hi Ranchers,

I cleared the exam with 86% score.
Your suggestions and guidance really helped me out.

Thanks a lot !!!

Regards
Kirti
Hi Everybody,

I am going to appear in SCJP 1.4 on Monday.

Please give me last minute suggeestions.

I scored 80% on K & B Master Exam.....how much can i score on real exam...any guesses??

Thanks
Kirti
Thank you all for help....i myself got it....:-)
class base
{
}
class sub extends base
{
public static void main(String args[])
{
base b=new base();
sub s=new sub();
s=(sub)b;
}
} /* will compile fine but will fail during runtime as base object is not pointing to sub object.*/

It will work fine even during runtime if base class reg points to subclass object.

class base
{
}
class sub extends base
{
public static void main(String args[])
{
base b=new sub();
sub s=new sub();
s=(sub)b;
}
}

Thanks

But it can cause runtime exception if the supertype doesn't point to the specified subtype at runtime.



Please let me know what does that mean actually....With the help of syntax?

Thanks
Kirti
Hi Ranchers,

I am pretty confused in scenarios in which superclass ref is assigned to subclass or vice-versa or say objects assignments are being done in context of inheritance??

Sometimes it is compiler error, sometimes runtimeerror.....

Can anybody help me out by stating example for the possible scenarios--when does it compiler error and when is it runtime???

I will be greatful.

Thanks
Kirti
Hi,

Just to add what Mamatha told you, its you who knows that result of modular falls within Char range but compiler raises its brows without actually calculating the result. so you are required to put an explicit cast.

char a3 = (char)(a2%a1);

It will solve your problem.

Thanks
Kirti
Thanks Henry for your help!!!

Regards
Kirti
Thanks Mamatha.....but a byte can have integer values up to 127 without requiring a cast...so why does it giving an error..am still not getting...

Regards
Kirti
Hi All,

Looking forward for your help for a small question....
Byte b=new Byte(1); // 1
Why does it throw Compiler error even though its in byte range??? and then what is supposed to be passed to arg while creating Byte object???

Also, why below statement does not produce compiler error-
Byte b=new Byte("1"); //2

If 1st stmt is giving us error then 2nd should also give as its simply string representation of primitive....

Please clarify.

Thanks
Kirti
Hi Ranchers.....I have been following K & B for SCJP 1.4.

While creating Wrapper objects, arg takes a primitive of the type being constructed as per book.

but i tried creating Float wrapper objects that works fine even when we pass double/char/integer.....i dint get it??

Also, if its the case then creating an Integer object with Long as arg doesn't work....so why does it differ from float constructors which can take double as an arg....??

Am confused.....please do let me know what all args are compatible while creating wrappers for int and float???

Thanks
Kirti
Thanks Nirav.....but still how could you find E?? I am not getting it.....Please help.

Regards
Kirti
Hi Barry.
Below are the options to choose from.



Given the following,
1. public class Test {
2. public static void main(String [] args) {
3. byte [][] big = new byte [7][7];
4. byte [][] b = new byte [2][1];
5. byte b3 = 5;
6. byte b2 [][][][] = new byte [2][3][1][2];
7.
8. }
9. }
which of the following lines of code could be inserted at line 7, and still allow the code to
compile? (Choose four that would work.)
A. b2[0][1] = b;
B. b[0][0] = b3;
C. b2[1][1][0] = b[0][0];
D. b2[1][2][0] = b;
E. b2[0][1][0][0] = b[0][0];
F. b2[0][1] = big;

Please let me know about thge soln.
thanks
Hi Ranchers....am preparing for SCJP 1.4 and not getting through this question. Please help me out.
Given the following,
1. public class Test {
2. public static void main(String [] args) {
3. byte [][] big = new byte [7][7];
4. byte [][] b = new byte [2][1];
5. byte b3 = 5;
6. byte b2 [][][][] = new byte [2][3][1][2];
7.
8. }
9. }
which of the following lines of code could be inserted at line 7, and still allow the code to
compile? (Choose four that would work.)


Please do let me know about the approach to go for.
Thanks