What does the following code print?
public class Test {
public static void main(String[] args) {
String str = "Hello";
str.concat(" World");
System.out.println(str);
} }

debug2Main

Flashcard
•
Information Technology (IT)
•
University
•
Hard
Quizizz Content
FREE Resource
Student preview

20 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Back
Hello
2.
FLASHCARD QUESTION
Front
What will the following C++ code output?
int main() {
char *ptr = "Hello";
ptr[0] = 'h';
cout << ptr;
return 0;
}
Back
Segmentation fault
3.
FLASHCARD QUESTION
Front
What happens if we run the following Python snippet?
try:
x = 1 / 0
except ZeroDivisionError:
print("Zero error")
except: print("Other error")
Back
Zero error
4.
FLASHCARD QUESTION
Front
What happens if a delete operator is used on a NULL pointer?
Back
Does nothing
5.
FLASHCARD QUESTION
Front
Which of the following will cause memory leaks in C++? A) Not using delete after new, B) Using malloc() without free(), C) Assigning a new pointer without deleting the old one, D) All of the above
Back
All of the above
6.
FLASHCARD QUESTION
Front
What is the issue with the following C++ code? int main() { int* ptr = new int; return 0; }
Back
Memory leak
7.
FLASHCARD QUESTION
Front
What will be the output of this Python code?
def func():
print("Hello")
x = func()
print(x)
Back
Hello None
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Python Programming Flashcard

Flashcard
•
University
16 questions
Python Basics Unit 3.1

Flashcard
•
12th Grade
15 questions
Computer Science 1301 Final Questions

Flashcard
•
University
15 questions
Нысаналы мектеп информатика 3-аралық тест

Flashcard
•
KG - University
15 questions
Python modules, operators and random

Flashcard
•
University
14 questions
AP CS ArrayLists

Flashcard
•
12th Grade
15 questions
CSE 102 Exam 3 Practice

Flashcard
•
University
15 questions
CSE 102 Exam 3 Practice

Flashcard
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade