OOP evaluation

OOP evaluation

University

13 Qs

quiz-placeholder

Similar activities

SAINS KOMPUTER 1.3

SAINS KOMPUTER 1.3

University

11 Qs

OOP - Java Classes

OOP - Java Classes

12th Grade - University

15 Qs

Java Основи

Java Основи

11th Grade - University

16 Qs

Third Year Placement Training Revision Test

Third Year Placement Training Revision Test

University

10 Qs

Round 4 - Harvest

Round 4 - Harvest

University

15 Qs

Methods

Methods

University

10 Qs

OOP

OOP

University

13 Qs

Methods

Methods

University

11 Qs

OOP evaluation

OOP evaluation

Assessment

Quiz

Computers

University

Hard

Created by

pubudu s

Used 3+ times

FREE Resource

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

public class Example {

public static void main(String[] args) {

String str1 = "hello";

String str2 = "world";

String result = str1 +" "+ str2;

System.out.println(result);

}

}

helloworld

hello world

worldhello

Compilation Error

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What would the new value of A be?

A=5;

System.out.println(A++);

6

3

5

4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what's the output of below code?

public static void main(String []args){

int z =50;

System.out.println(x);

m();

}

public static void m(){

int z =55;

System.out.println(x);

}}

55,50

55,55

50,55

50,50

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code output?

int x = 1;

System.out.println(++x);

1

2

compilation error

runtime error

5.

MULTIPLE SELECT QUESTION

30 sec • 2 pts

Which statement(s) are equivalent to i = i + 1?

i += 1

i--

i -= 1

i++

6.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

If a=10, b=5, c=12

Find result for : 8 * (a + b + c) – a % c

78

206

77

216

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

public class A{

int h =10;

static int p=20;

public static void main(String args[]){

int x =5;

System.out.println(x);

System.out.println(p);

System.out.println(h);

}

}

5,20,Erorr

Error

Error,5,20

5,20,10

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?