What are the naming conventions for classes and methods in Java?
Anonymous Quiz
58%
a) PascalCase for classes and camelCase for methods
26%
b) camelCase for classes and PascalCase for methods
8%
c) Both PascalCase
8%
d) Both camelCase
Note:
Java programs are compiled into bytecode and then interpreted or compiled using Just-In-Time (JIT) compilation at runtime.
@AceCoding
Java programs are compiled into bytecode and then interpreted or compiled using Just-In-Time (JIT) compilation at runtime.
@AceCoding
Which of these is NOT a keyword in Java?
Anonymous Quiz
0%
a) static
5%
b) abstract
54%
c) include
41%
d) transient
Why do we write String with an uppercase S?
Anonymous Quiz
26%
a) It is a convention for data types in Java
63%
b) It is a class in Java, not a primitive type
3%
c) To make it case-sensitive
8%
d) To differentiate it from arrays
How many methods are defined in the String class?
Anonymous Quiz
22%
a) 20
20%
b) 30
54%
c) 50
5%
d) 60
Why donβt we need to create new objects for strings if they are reference types?
Anonymous Quiz
3%
a) Strings are not reference types
26%
b) Strings are non-primitives
23%
c) Strings are dynamically allocated
49%
d) Strings are immutable and stored in a String pool
What is the correct output of System.out.println((10 + 3) , \" Hello\");?
Anonymous Quiz
19%
a) 13 Hello
3%
b) 10 3 Hello
0%
10 + 3 Hello
0%
c) 10 + 3 Hello
78%
d) Error
What is the correct output of System.out.println(10 + 3 + " Hello");?
Anonymous Quiz
58%
a) 13 Hello
19%
b) 10 3 Hello
3%
c) 10 + 3 Hello
19%
d) Error
Forwarded from < Ace Coding /> π
Mosh-cheat-sheets.zip
7.1 MB
π Cheat Sheets by Mosh π
Quick reference for Java, Python, SQL, and Git! π
βοΈ Java Cheat Sheet
π Python Cheat Sheet
π SQL Cheat Sheet
π» Git Cheat Sheet
Stay tuned for more! π₯
ππ @AceCoding Presents! ππ
#Java #Python #SQL #Git #CheatSheet
Quick reference for Java, Python, SQL, and Git! π
βοΈ Java Cheat Sheet
π Python Cheat Sheet
π SQL Cheat Sheet
π» Git Cheat Sheet
Stay tuned for more! π₯
ππ @AceCoding Presents! ππ
#Java #Python #SQL #Git #CheatSheet
Forwarded from < Ace Coding /> π
if (10 > 5)
int sum = 10 + 5;
System.out.println(sum);
Forwarded from < Ace Coding /> π
Whatβs wrong with the above snippet of code?
Anonymous Quiz
40%
a. Perfectly fine
14%
b. Sum is not printed
21%
c. Runtime error
24%
d. Compilation error
Forwarded from < Ace Coding /> π
Predict the output:
int i = 0;
while (++i < 5);
cout << "i: " << i << endl;
Forwarded from < Ace Coding /> π
Choose your answer for the above code.
Anonymous Quiz
31%
π
°οΈ i: 4
21%
π
±οΈ i: 5
18%
π
ΎοΈ i: 6
18%
β Infinite loop
13%
β Compilation error
Forwarded from < Ace Coding /> π
Predict the output:
int x = 5;
int y = 10;
(x > y ? x : y) = 50;
cout << "x: " << x << ", y: " << y << endl;
Forwarded from < Ace Coding /> π
Choose your answer for the above.
Anonymous Quiz
4%
π
°οΈ x: 50, y: 50
4%
π
±οΈ x: 10, y: 50
65%
π
ΎοΈ x: 5, y: 50
19%
β Undefined behavior
8%
β Compilation error
Forwarded from < Ace Coding /> π
Predict the output:
int a = (3, 4, 1, 2);
cout << a ;