1Z0-811 Primitives, Strings and Operators • Complete Question Bank
Complete 1Z0-811 Primitives, Strings and Operators question bank — all 0 questions with answers and detailed explanations.
Refer to the exhibit.
public class Test {
public static void main(String[] args) {
int x = 10;
int y = x++ + ++x;
System.out.println(y);
}
}A developer writes the following code:
int a = 5; int b = 2;
double result = a / b; System.out.println(result);
What is the output?
public class Test {
public static void main(String[] args) {
String s1 = "Java";
String s2 = new String("Java");
String s3 = "Java";
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
System.out.println(s1 == s3);
}
}Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
0
false
0.0d
'\u0000'
0L
Drag a concept onto its matching description — or click a concept then click the description.
Compiles .java source files into .class bytecode
Launches the Java application (JVM)
Generates API documentation from source code comments
Creates and manages JAR archives
Debugger for Java programs
Refer to the exhibit.
public class Test {
public static void main(String[] args) {
int a = 10;
int b = 20;
boolean result = a > b ? a < b : a == b;
System.out.println(result);
}
}public class Test {
public static void main(String[] args) {
int a = 3;
int b = 5;
int c = a * b + 2;
System.out.println(c);
}
}public class StringTest {
public static void main(String[] args) {
String s = "Hello";
s.concat(" World");
System.out.println(s);
}
}public class BooleanCheck {
public static void main(String[] args) {
boolean a = true;
boolean b = false;
boolean c = a || b && !a;
System.out.println(c);
}
}String str1 = "Java";
String str2 = new String("Java");
System.out.println(str1 == str2);int x = 5; int y = 0; int z = x / y; System.out.println(z);
String s1 = "Hello"; String s2 = "Hello"; System.out.println(s1 == s2);
Refer to the exhibit.
javac Test.java
Test.java:3: error: incompatible types: possible lossy conversion from int to byte
byte b = 200;
^
1 errorRefer to the exhibit.
public class Test {
public static void main(String[] args) {
String s1 = new String("Java");
String s2 = "Java";
System.out.println(s1 == s2);
}
}
Output: falseint a = 10; int b = 5; int c = a++ + --b * 2; System.out.println(c);