Java Programming Quiz

Java Programming Quiz

Professional Development

60 Qs

quiz-placeholder

Similar activities

FTCE- Media Specialist Test

FTCE- Media Specialist Test

Professional Development

62 Qs

REVIEWER APH : OTEP

REVIEWER APH : OTEP

Professional Development

56 Qs

PRE - TEST [English Grammar & Writing Class (WEEKDAYS)]

PRE - TEST [English Grammar & Writing Class (WEEKDAYS)]

10th Grade - Professional Development

65 Qs

DEP Start Guide Test

DEP Start Guide Test

12th Grade - Professional Development

63 Qs

My hero Academia

My hero Academia

5th Grade - Professional Development

56 Qs

Face/Off   Queue Vs CC Batch

Face/Off Queue Vs CC Batch

Professional Development

60 Qs

Interim Mock Ch-13 to Ch-15

Interim Mock Ch-13 to Ch-15

Professional Development

57 Qs

FF2 Final

FF2 Final

Professional Development

55 Qs

Java Programming Quiz

Java Programming Quiz

Assessment

Quiz

Other

Professional Development

Medium

Created by

Venubabu Venubabu

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

60 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following program? interface I1 { default void m2() { System.out.println("bye"); } void m1(); } @FunctionalInterface interface I2 extends I1 { default void m2() { System.out.println("hello"); } } public class Test { public static void main(String[] args) { I2 x = () -> System.out.println("hi"); x.m1(); x.m2(); } }

hi bye

Compilation Error

hi hello

Runtime Error

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will the output of the following code? public interface A111 { String s = "yo"; public void method1(); } interface B { } interface C extends A111, B { public void method1(); public void method1(int x); }

Compilation succeeds.

Compilation fails due to multiple errors.

Compilation fails due to an error only on line 20.

Compilation fails due to an error only on line 21.

Compilation fails due to an error only on line 22.

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following program? import java.util.function.Predicate; public class Test { public static void main(String[] args) { Predicate greater = a -> a > 15; Predicate less = a -> a < 10; boolean bool = greater.test(20); boolean bool1 = less.test(5); System.out.println(bool); System.out.println(bool1); } }

no output

true true

true false

true

true true

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Is there any error in the following code? @FunctionalInterface public interface MyInterface { String myInterface(String a); int hashCode(); String toString(); }

The code will compile.

The code will give a compilation error.

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following program? @FunctionalInterface interface MyInterface { String cal(String value); } public class FunctionalInterfaceExample { public static void main(String[] args) { MyInterface myInterface = (String value) -> 75 + value; System.out.println(myInterface.cal("hi" + 25)); } }

hi7525

hi2527

75hi25

hi100

None of the above

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following program? @FunctionalInterface interface MyInterface { public String nit(String name); } public class FunctionalInterfaceExample { public static void main(String[] args) { MyInterface myInterface = (String name) -> "Welcome to "; System.out.println(myInterface.nit("Learning")); } }

Welcome to Learning

Learning Welcome to

No output

Compile time error

Welcome to

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following program? @FunctionalInterface interface Movie { String movieName(); } public class TestMcq { public static void main(String[] args) { Movie m = () -> return "DDLJ"; System.out.println(m.movieName()); } }

No output

DDLJ

ddlj

Movie

Compile time error

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?