La sentencia switch es una declaración rama multivÃa. La forma general de la sentencia switch es la siguiente: switch (expresión) {case valor1: / / romper las declaraciones; caso valor2: / / sentencias break;. . por defecto: / default declaraciones /} La expresión debe ser de tipo int, char, byte, o corta tipo de datos y el tipo de datos de los valores especificados deben ser compatibles con la expresión. Cada valor caso debe ser un valor literal único. Las variables no están permitidos como valores caso. El proceso de ejecución de una sentencia switch es la siguiente: El valor de la expresión se corresponde con cada uno de los valores literales en los estados caso. Si se encuentra una coincidencia, entonces la secuencia de código siguiente sentencia case se ejecuta. Si ninguno de los valores coinciden, entonces la declaración por defecto se ejecuta. Si la declaración por defecto no se da ningún valor y se pongan en venta se encuentra, entonces no se adoptan nuevas medidas. Descargar cuestión práctica y guÃa de estudio para CX310-019 para el examen.
March 2, 2011
¿Cuál es la sentencia switch?
March 2, 2011
Las nuevas caracterÃsticas de Java examen de certificación
And the other in which only a particular member of a class is imported.
import static packageName.ClassName.membername;
For example:
import static java.lang.Math.*;
public class StaticImportTest
{
public static void main( String args[] )
{
System.out.println( “Square root of 400 =”+sqrt(400.0 ) );
}
}
StringBuilder
StringBuilder is a class, which is very similar to the StringBuffer class. It is a new concept introduced in J2SE 5. Like the String and the StringBuffer classes, it extends directly from the Object class. The StringBuilder class can act as an alternative to StringBuffer in places where the environment is not multithreaded, i.e, where synchronization or multithreading is not significant. The signature of the StringBuilder class is as follows:
public final class StringBuilder extends Object implements Serializable, CharSequence
Since StringBuilder is not synchronized, it offers faster performance than StringBuffer.
An example of using StringBuilder is given below:
import java.util.*;
public class StrBld
{
public static String likeJava(List
{
StringBuilder b = new StringBuilder();
for (Iterator
{
b.append(i.next()).append(” “);
}
return b.toString();
}
public static void main(String[] args)
{
List list = new ArrayList();
list.add(“I”);
list.add(“like”);
list.add(“java”);
System.out.println(StrBld.likeJava(list));
}
}
This will compile and execute to give the output “I like java”.
Some of the important methods of StringBuilder class are as follows:
public StringBuilder append(char c)
It appends the string representation of the char argument to the current sequence.
The argument is appended to the contents of this sequence. It increases the length of the sequence by 1.
public int capacity()
This will return the current capacity of the StringBuider.
public StringBuilder insert(int offset,boolean b)
This will insert the string representation of the boolean argument into current sequence.
public StringBuilder reverse()
This will cause the character sequence to be replaced by the reverse of the sequence.
public String toString()
This will return a string representing the data in current sequence
public StringBuilder replace(int start, int end, String str)
This will replace the characters in a substring of this sequence with characters in the specified String. The substring begins at the specified start and extends to the character at index end – 1 or to the end of the sequence if no such character exists.
free study material for CX310-055 OCP Java SE 5 Programmer exam.
February 18, 2011
What is the main() method?
public static void main (String args)
where the keyword public is an access specifier that declares the main() method as unprotected, making it accessible to all other classes.
The keyword static makes the method static, so that it may be executed without constructing an instance of the corresponding class.
The args array contains an argument that the user might enter on the command line.
Best exam simulation free download CX310-065
February 17, 2011
What is the HTTPS protocol?
The Hypertext Transfer Protocol Secure (HTTPS) protocol is a protocol used in the Universal Resource Locater (URL) address line to connect to a secure site. If a site has been made secure by using the Secure Sockets Layer (SSL), then the HTTPS instead of the HTTP protocol should be used as a protocol type in the URL.
- exam guide for 1D0-450 test.
- Become CIW CIW Internetworking Professional certified.
- Get certified in first attempt download 1D0-470 – CIW Security Professional simulation.
December 21, 2010
What are the DELETE and TRUNCATE commands?
DELETE and TRUNCATE are two commands that remove rows from a table but each will do it in a different manner. DELETE removes rows and places them in the Undo tablespace, thus it requires COMMIT to confirm the delete operation. TRUNCATE, on the other hand, is an Auto Commit operation and hence, does not require COMMIT to confirm the removal.
TRUNCATE does not have the WHERE clause so it is better to use TRUCATE when all rows are to be deleted from the table. Also TRUNCATE being Auto Commit, uses minimum Undo tablespace.
If rows from a table are to be removed conditionally, then DELETE statement with the WHERE clause should be used. The condition is given in the WHERE clause and DELETE removes only those rows that satisfy the given condition. If no WHERE clause is specified, then all the rows in the table are deleted.
Note: It must be assured that the WHERE clause is included in DELETE whenever required, as without the WHERE clause, the DELETE statement could lead to unwanted consequences.
Download free practice test for Oracle MySQL Associate exam.
December 7, 2010
What are the isolation levels supported by MySQL?
Download practice question and study guide for CX-310-813 for exam.
Click here to download CX-310-814 test study guide and practice question.
December 7, 2010
What types of full-text search exist in MySQL?
Become Oracle Oracle MySQL Associate certified.
November 10, 2010
What is TRUNCATE TABLE statement?
TRUNCATE TABLE is used to empty a table completely. It is similar to a DELETE statement that deletes all rows, but there are practical differences under some conditions. From MySQL 5.0.3, row by row deletion is used in the TRUNCATE TABLE statement provided that there are any FOREIGN KEY constraints that reference the table.
- Download free practice test for MySQL 5.0 Developer exam.
- Click here to get free CX-310-814 Oracle MySQL Associate study guide.
November 10, 2010
What is REPLACE statement?
REPLACE statement works exactly like INSERT statement with the exception that the old row is deleted before the new row is inserted if, for a PRIMARY KEY or a UNIQUE index, an old row in the table has the same value as a new row. REPLACE is a MySQL extension to the SQL standard.
- Download free practice test for MySQL 5.0 Developer exam.
- Download questions and guide CX-310-814 for exam.
October 9, 2010
What is a simple view?
A simple view is a view where the SELECT SQL statement of the view fetches data from one table only. Such views are usually simple SELECT statements on the base tables. Since the view is simple and the columns of the view are directly related to the columns of the table, i.e., they have a one-to-one-relationship, DML operations are allowed on such views; DML operations on a simple view would directly affect/update the base table. DML operations include INSERT, UPDATE, or DELETE statement of SQL. This is the reason why simple views do not have any usage of SQL group functions (SUM, AVG, COUNT, etc.) or grouping of data (GROUP BY).
Example :
CREATE VIEW V1 AS
2 (SELECT ENAME, SAL FROM EMP);
View created
DESC V1
| Name | Null? | Type |
| ———— | ———- | ——————– |
| ENAME | VARCHAR2(10) | |
| SAL | NUMBER(7,2) |
Download questions and guide CX-310-813 for exam.
Download free practice test for SCMA MySQL practice test exam.
