59.Classes - Adding functionality into class

59.Classes - Adding functionality into class

Professional Development

31 Qs

quiz-placeholder

Similar activities

C# Basic

C# Basic

Professional Development

30 Qs

Scripting Languauges

Scripting Languauges

Professional Development

27 Qs

Examen Unidad V. Excepciones en Programación

Examen Unidad V. Excepciones en Programación

Professional Development

27 Qs

129.Comparable interface

129.Comparable interface

Professional Development

28 Qs

HTML and CSS

HTML and CSS

University - Professional Development

36 Qs

Kotlin-Lesson 1 to 3 Programming Quiz

Kotlin-Lesson 1 to 3 Programming Quiz

Professional Development

35 Qs

100Devs - LwL - Class01 - Internet and HTML Basics

100Devs - LwL - Class01 - Internet and HTML Basics

9th Grade - Professional Development

32 Qs

Java Basics

Java Basics

Professional Development

27 Qs

59.Classes - Adding functionality into class

59.Classes - Adding functionality into class

Assessment

Quiz

Computers

Professional Development

Hard

Created by

ANIL KUMAR

FREE Resource

31 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do you add a function to a class in Java?
Define within another method
Use the "implements" keyword
Use the "extend" keyword
Define within the class

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How to use function of one class in another class in Java?
Use the "friend" keyword
Use the "inherits" keyword
Create an object and call the function
Use the "include" keyword

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Can a class implements another class in Java?
Yes, using the "inherits" keyword
Yes, with multiple inheritance
No, Java does not support class inheritance
Yes, using the "implements" keyword

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Can you put functions in a class?
No, functions are not allowed in classes
Yes, but only outside the class
No, functions must be in separate files
Yes, either inside or outside the class

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Can I create a function inside a class?
No, functions must be created outside classes
No, Java does not support functions
Yes, but only in a different file
Yes, inside a class

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How to connect two classes in Java?
Use the "friend" keyword
Use the "include" keyword
Use the "import" keyword
Create objects and call methods

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do I make a class function friend to another class?
Use the "friend" keyword
Declare as a public function
Use the "inherits" keyword
Java does not have friend classes

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?