Search Header Logo

59.Classes - Adding functionality into class

Authored by ANIL KUMAR

Computers

Professional Development

59.Classes - Adding functionality into class
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

Access all questions and much more by creating a free account

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

Already have an account?