Bert Bates wrote:I totally agree with "code, code, code"...
One idea is that every mock exam question you look at (whether it's from K&B or some other source), has the potential to be a small program that you can recreate and study, and modify, and test, and in general futz around with. So find a question you have some doubts about, type it in, compile it, run it, tweak it, compile and run again.
Prasad Kharkar wrote:code code code means
suppose you are studying the Exceptions chapter
and you know the purpose of try catch finally
but for studying thoroughly
you do following things
1. write small programs that demonstrate each combination of try catch block (means check whether we can write catch after finally or only try block etc etc )
2. do separate programs for that
3. generally we throw exceptions in try block only but see what is the result if you throw exception in catch block or the finally block
4. we write return statements in methods but try to return from catch block, finally block, try block and see what happens
5. when using exceptions of same inheritance tree, try changing the order of catch blocks to catch exceptions
Now suppose you are studying for inner classes
then you should take into considerations following questions
1. can a class contain an inteface?
2. Can a static nested class extend a non static inner class?
3. can we extend an inner class from one outer class into another inner class from another outer class?
when studying for threads
1. try to synchronize code
2. write separate programs by creating threads by both extending Thread class and implementing Runnable interface
and when you write programs
give meaningful names to your classes
and comment them when you need it
that too because if you are going for the exam tomorrow and you need a quick revision of the concepts
you have learned through programming then you can read those comments
I am giving a sample program I had written for the preparation
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton