CS402 T04

CS402 T04

Professional Development

15 Qs

quiz-placeholder

Similar activities

Quiz String

Quiz String

Professional Development

10 Qs

Introduction

Introduction

Professional Development

10 Qs

Basic Programming Kotlin

Basic Programming Kotlin

Professional Development

10 Qs

PROGRAMACION.1.Conceptos Básicos

PROGRAMACION.1.Conceptos Básicos

Professional Development

15 Qs

JDK,JRE,JIT & JVM MCQs

JDK,JRE,JIT & JVM MCQs

Professional Development

12 Qs

C++ Programming

C++ Programming

Professional Development

20 Qs

ICT 10 M6 QUIZIZZ

ICT 10 M6 QUIZIZZ

Professional Development

10 Qs

Python Interaction

Python Interaction

9th Grade - Professional Development

20 Qs

CS402 T04

CS402 T04

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Mike Wong

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

1. What is the correct way to define a character in Java?

char c = "A";

char c = 'A';

char c = A;

char c = 'AB';

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

2. What will be the output of the following code?

char c = 65;

System.out.println(c);

A

65

Compilation Error

Null

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

3. What does System.out.println('\\'); print?

/

\

\\

Compilation Error

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

4. How do you find the length of a string str in Java?

str.size()

str.length

str.length()

str.len()

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

5. What happens if you try to access an index outside a string's length using charAt()?

Returns null

Returns '0'

Error, throws StringIndexOutOfBoundsException

Returns ' '

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

6. Which method converts a string to uppercase in Java?

str.toUpper()

str.upper()

str.toUpperCase()

toUpperCase(str)

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

7. What does Math.random() return?

A random int value

A random value between 1.0 and 10.0

A random double value greater than 1.0

A random value between 0.0 and smaller than 1.0

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?