Posts Tagged ‘310-035’

What is an assertion?

August 12th, 2008

An assertion is a statement that is assumed to be true during the execution of a program. It returns a boolean result. If the result is true, the code executes normally and no other action takes place. This confirms that the assumed statement is true. If the result is false, an AssertionError is thrown. The assertion condition is tested using the assert keyword. The assert keyword has the following two forms:

  • assert assertCondition;
    Here, assertCondition is an expression that evaluates to a boolean expression.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is the Vector class?

September 22nd, 2007

The Vector class is used to create a generic dynamic array known as vector. It is contained in the java.util package. It implements the List interface. A vector can be created with or without explicitly specifying its size. Vector is synchronized. It can be expanded to hold more elements when needed. As all classes in Java inherit from the Object class, a vector can hold objects of any class. However, it cannot directly store primitive data types.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is the toHexString() method of the Integer class?

September 22nd, 2007

The toHexString() method converts an integer value into a hexadecimal string. The Integer class defines this method with the following signature:

public static String toHexString(int i)

The given signature of the method suggests that it takes an int argument and returns a String object. The String object returned by the method is a string that represents an unsigned integer in base 16.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is the default value of the elements of an array?

September 21st, 2007

As soon as an array is created using a new operator, its elements are automatically initialized to their default values. This automatic initialization of the elements depends on the data type of the array. The following table shows the initial value of the elements of an array:

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What are keywords?

September 21st, 2007

Every computer language uses some reserved words known as keywords. They are an essential part of the language. In Java, keywords are defined in lower case and cannot be used as identifiers. The table below shows the list of keywords used in the Java language:

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is the min() method?

September 21st, 2007

The min() method is a static method of the java.lang.Math class. It takes two values as its arguments and returns the smaller of the two values. The min() method is overloaded with separate versions for the int, long, float, and double arguments. The signatures of the different versions of the min() method are given below:

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What are character literals?

September 21st, 2007

Character literals are 16 bit Unicode characters that are used to represent a single character. They are generally used to initialize variables declared as char. They can also be converted into integer types and manipulated with integer operators.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is an interface?

September 13th, 2007

An interface is a reference type that defines a contract. An interface body consists of method declarations and constants. All methods and constants in an interface are public. Interfaces are left completely unimplemented, i.e., no method in the interface is implemented. All methods of an interface are abstract and the method body is absent. A class may access one or more interfaces simultaneously. An interface is defined using the syntax below:

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is an abstract class?

September 11th, 2007

An abstract class is a class that is partially implemented. It provides design convenience. An abstract class is made up of one or more abstract methods that are declared but left unimplemented. An abstract class may also contain non-abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. However, if it does not, the subclass must also be declared abstract.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark

What is a constructor?

May 11th, 2005

A constructor is a special type of method. It initializes an object immediately upon creation. It has the same name as the class in which it resides. A constructor is automatically called immediately after an object is created, before the new operator completes. A constructor can be marked as public, protected, or private. It has no explicit return type, not even void.

Like this article? Share it with others
If you like this article, please leave a comment or subscribe this blog via RSS or via e-mail, Bookmark and share through your network. Click the AddThis button below. Thanks.
  • Share/Bookmark
uCertify.com | Our Company | Articles | Contact Us | News and Press Release | uCertify India | Entries (RSS)
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD    Cisco Certification: CCNA, CCENT    A+, Network+, Security+ Project+
Oracle Certification: OCP 11g, OCP 10g, OCA 11g, OCA 10g    CIW foundation    EC-212-32,    CISSP    Photoshop ACE CS4    Adobe Flash ACE, PMP, CAPM
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.