File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Tips,oneliner Just  before the SCJP Exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Tips,oneliner Just  before the SCJP Exam" Watch "Tips,oneliner Just  before the SCJP Exam" New topic
Author

Tips,oneliner Just before the SCJP Exam

N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Hi friends,
Here goes an idea to contribute as well as learn at the same time.
For friends who are facing this Exam in short notice might
get some benifit by simply browsing through this Thread(I know
One such thread has been in vogue for quite some time!).
Here goes my contribution:
************************************************************
1.No append() for String class.
2.concat() for String and append() for StringBuffer do the same.
They glue two strings together.......(watch out for more...)....correct me please ...nm


"Knowledge is Power"****************<A HREF="http://www.geocities.com/nityananda_mukherjee" TARGET=_blank rel="nofollow">THREAD/SCJP RESOURCES</A>
N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Hi again,
Here goes a list:
3.Math class constructor is private;So it cannot be called.
4.All Exceptions are subclasses of a class called "java.lang.Throwable".
5.CheckedExceptions must be caught/ or, rethrown.
6.abstract method can not be (a) final (b)static or (c)private.
7.final class can have -->static methods
But cannot have-->abstract methods.
8."Threading" and "Garbage Collection" are platform dependent.
More to come.......corrections if any...most welcome.....Thanks......nm
Prasanna Joshi
Greenhorn

Joined: Apr 25, 2000
Posts: 11

AWT : MenuItem extends MenuComponent extends Object
Exceptions :
The Object thrown by a throw statement must be assignable to the Throwable type.This includes the Error and Exception types.
Basics :
The "goto" and "const" are keywords which are reserved by Java
"true" and "false" are technically boolean literals
"null" is technically a null literal.
IO :
InputStream and OutputStream are byte Oriented
Reader and Writer classes are character Oriented

[This message has been edited by Prasanna Joshi (edited July 05, 2000).]
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
2.concat() for String and append() for StringBuffer do the same.
They glue two strings together.......(watch out for more...)....correct me please ...nm

Be careful here! You need to know this for the exam. You must know that concat() creates a new string and doesn't append to the current/existing one; StringBuffer just builds on the same object. This is VERY important for questions on Strings and StringBuffers using '.equals()' or '=='...

[This message has been edited by Paul Smiley (edited July 05, 2000).]
snafu man
Greenhorn

Joined: Aug 13, 2003
Posts: 2
nan'na bhai, esab ki, ami kicchhui bujhte parcchhi na
N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Thanks Paul,
I have some more......
(*)strictfp is a Keyword.
(*)finally{} block in Exception Handling always executed even if we use break
The only exception being System.exit(0).
***************
Looking for corrections and contributions from friends specially JavaGuru....
***************
[This message has been edited by N Mukherjee (edited July 06, 2000).]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
NM,
could you please give some more details for cheched & unchecked exceptions.
Thanks in advance,
DS
ricky gonzalez
Ranch Hand

Joined: Jun 30, 2000
Posts: 167
Sorry, but what does strictfp do? I didn't see that any where.
Thanks.
N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Hi Deepak, Ricky,
Well strictfp is to make certain floating point computation faster for
processors like "Pentium".
USE:strictfp class AnyClass{
//write anything
}
for more of "strictfp" just search within this forum.
Exception could be checked or Runtime type. Former includes IOException,FileNotFoundException,InterruptedException
Runtime or UncheckedExceptions are ArithmaticException,NullPointerException and
NumberFormatException etc...Hope this will help......Thanks...nm
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
tips for equals:
object equals() shallow compare, ref == ref
string equals() deap compare, value eq value
stringbuffer equals() shallow compare
tips for length:
array x.length
string x.length()
stringbuffer x.length()
all primative reference, conversion, & casts are determined at compile time.
all object referenced (including interfaces and arrays) conversion are detemined at compile time. casting is split between compile and runtime.
Monty6
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
(*)finally{} block in Exception Handling always executed even if we use break The only exception being System.exit(0).
Well- almost! There are other instances, like an OutOfMemory error where the whole program dies, but that probably won't be on the test...
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
...or if you turn off your computer before it completes execution...


"I'm not back." - Bill Harding, Twister
N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Thanks Everybody,
Let us discuss some more*************
1.Valid switch arguments are byte, int, short, char only.
2.No access specifier to a class implies it is "friendly"(By default).
3.int a[][], int[]a[] or int [][]a all three are valid expressions.
4.constructors can not be native, abstract, static, synchronized or final.
5.int i=019//ILLEGAL (Guess why?)
6.byte b=10b;char c=17c;short myshort=99S//ALL are invalid
Special Thanks to Marcus Green for his nice tutorial.It was simply too good.
Thanks once again.
Looking for corrections and additions specially from Paul and others......nm
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
...or, if you cross the international time line in a boat at 12:00 GMT precisely and your PC is struck by lightning during the catch statement execution...
Sorry, I had to do it...
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

A link to one such post we all contributed when we were in the heat of the preparation....contains a lot of must see oneliners..
enjoy
Regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Paul McKenna
Ugly Redneck
Ranch Hand

Joined: Jul 08, 2000
Posts: 1006
Please could someone tell me how much the SJCP tests the following areas:
Network Programming
java.util (Set,List,Map)

Commentary From the Sidelines of history
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
NM, & other JAVAgurus....
could u please provide some tips for IO(java.io package) also.this is one area which covers more than 4-5 questions in SCJP.i think we should start discussing it also...
thanks in advance
DS
Marcela Blei
Ranch Hand

Joined: Jun 28, 2000
Posts: 477
Originally posted by N Mukherjee:
5.int i=019//ILLEGAL (Guess why?)


At first I didn�t think this was illegal, I compiled it and I got a: malformed integer number error and still didn�t known why. But when it tried to convert the number to the decimal format I discover that a 9 could�t be in an octal literal. It�s a simple and good question!
N Mukherjee
Ranch Hand

Joined: Jun 08, 2000
Posts: 141
Hi everbody,
Some more from my side:
1.using File class, one cannot change current directory
2.constructors can be private, protected,public.
3.Top level class can have three modifiers-public , abstract and final.
4.Static methods can be overloaded.But no overridding.
5.a=b=c=0//legal
6.note:"!7"//illegal...guess why???simple!!
Thanks for all of your kind participation.
Bye
Deepak M
Ranch Hand

Joined: Jul 10, 2000
Posts: 124
Originally posted by N Mukherjee:
3.Top level class can have three modifiers-public , abstract and final.
4.Static methods can be overloaded.But no overridding.
Bye

Correction !.....
Top-level class can have FOUR modifiers, the above and strictfp
Static methods are HIDDEN. Instance methods are overridden.
Hiding is similiar to overriding the only difference being its only for static methods and fields and member types !
shankar changayil
Greenhorn

Joined: Jul 26, 2000
Posts: 4
Static methods according to the below example can be overridden!!
class Test
{
static void show()
{
System.out.println("Show method in Test class");
}
}
public class Q2 extends Test
{
static void show()
{
System.out.println("Show method in Q2 class");
}
public static void main(String[] args)
{
Test t = new Test();
t.show();
Q2 q = new Q2();
q.show();
t = q;
t.show();
q =(Q2)t;
q.show();
}
}
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Yeah, static methods can be overriden but "polymorphism will not take place".
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
hi,
My contributions.
1) one can extend only from one class but implement may interfaces
2)Interfaces can be public or default only the methods are public by default even when no access specifiers are specified
ex
public interface i{
void main();
}
class x implements i{
//void main(){}// compiler complains should be public
public main(){} // works
}
3) Wrapper classes override equals method, the File class also overrides the equals() method
4). Integer i=new Integer(5);
i.equals(new Long(5)); returns false not a compile time error
more later
Regds.
Rahul.
[This message has been edited by rahul_mkar (edited July 26, 2000).]
 
Consider Paul's rocket mass heater.
 
subject: Tips,oneliner Just before the SCJP Exam
 
Similar Threads
writing data into a file only some part
Question on uri and RequestDispatcher
The constructor List(String) is undefine
overwriting some part of file(UPDATING ONLY SOME PART)
Diiference between String ,StringBuffer & StringBuilder