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 correct these ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "correct these ??" Watch "correct these ??" New topic
Author

correct these ??

sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186


* Runnable interface have only one method that is run()
* equals() method checks for only object types

* Garbage collection algorithm in java is vendor implemented

* A class inside a method can only have access to final variables.
* Strings are implemented as a class for which java overloads the + operator.
* To get the size of an array u must use the lenght property of an array ( array-var.length)
* To get the size of a String or StringBuffer objects u must use the length() method.
( string_var.length(), stringbuffer_var.length())
* The instanceof operator can be used to determine if a reference is an instance of a particular primitive wrapper class.
* The instanceof operator will always return ture if you ask if a reference is an instance of the object class.
* Interfaces can't contain constructors.

* Interfaces can't be instantiated.
* Constructors may be overloaded but can't be overriden.
* constructors can be declared private.

* Anonymous class can't have a constructor.
* A collection for storing bits as on-off information like a vector of bits.
* Collection is the root interface in the collection hierarchy
* Set and List interfaces extends from Collection interface.
* List is an ordered list and does allow duplicates( it can have more than one null element) , and search for elements in the list is by their integer index.
* Set is a unordered collection and does not allow duplicates


"SCJP5 | SCWCD5| DEVELOPER"
sasank manohar
Ranch Hand

Joined: Feb 14, 2008
Posts: 186
Can anyone whether these right or wrong!!!
Khurram Fakhar
Ranch Hand

Joined: May 29, 2000
Posts: 65
Well many of them r RIGHT
Ken Lai
Ranch Hand

Joined: Aug 06, 2000
Posts: 30
Just to clarify...
>> * A class inside a method can only have access to final
>> variables.
This is true for variables defined in the method or variables that are passed in to the method as parameters.
For a class defined in:
a) a non-static method - the class can access all variables in the enclosing class, not just final variables
b) a static method - the class can access only static variables in the enclosing class.
Please correct me if I got it wrong.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Ken- exactly right.
As for the others: right, except for these:
* equals() method checks for only object types
If you mean that the equals() method only works for Objects, not primitives, then yes. Otherwise I'm not sure what this means.
* The instanceof operator will always return ture if you ask if a reference is an instance of the object class.
Not if the reference contains a null. Otherwise true.
* Anonymous class can't have a constructor.
It can't define a constructor, but it can use a constructor from the class it's overloading.
<code><pre> class A {
public A(String name) {
System.out.println("This instance is named " + name);
}
public void method() {
System.out.println("old method");
}
}

class Test {
public static void main(String[] s) {
A a = new A("Anonymous") {
public void method() {
System.out.println("new method");
)
}
a.method();
}
}
</pre></code>
* A collection for storing bits as on-off information like a vector of bits.
??? No idea what this means. Collections are for many things; a Vector of bits is just one possibility.
* Collection is the root interface in the collection hierarchy
I suppose so, by definition. But you should be aware that Map is not in this hierarchy.

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

Joined: May 26, 2002
Posts: 79
* Anonymous class can't have a constructor.
It can't define a constructor, but it can use a constructor from the class it's "overloading".
Jim, you meant "extending", right?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Oops. Right, thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: correct these ??