Top "Ocpjp" questions

OCPJP (Oracle Certified Professional, Java Programmer), formerly Sun Certified Java Programmer (SCJP), is a certification for programmers experienced using the Java programming language.

Formatting using printf and format

In the following program class ZiggyTest2 { public static void main(String[] args){ double x = 123.456; char c = 65; int i = 65; System.out.…

java formatting scjp ocpjp
Why does Double.NaN==Double.NaN return false?

I was just studying OCPJP questions and I found this strange code: public static void main(String a[]) { System.out.…

java floating-point nan scjp ocpjp
java.sql.SQLException: No suitable driver found

I am trying to execute simple query using below DbQuery.java class which uses DbConnector to get a Connection from …

java jdbc sqlexception ocpjp
How can't we compare two enum values with '<'?

If enum implements Comparable so why can't compare with < or >? public class Dream { public static void main(String... …

java enums scjp ocpjp
Why can not I add two bytes and get an int and I can add two final bytes get a byte?

public class Java{ public static void main(String[] args){ final byte x = 1; final byte y = 2; byte z = x + y;//ok …

java int variable-assignment scjp ocpjp