59.Classes - Adding functionality into class

59.Classes - Adding functionality into class

Professional Development

31 Qs

quiz-placeholder

Similar activities

A+ 1102 Day 3c Identify the basics of scripting

A+ 1102 Day 3c Identify the basics of scripting

Professional Development

30 Qs

Основы Web-программирования

Основы Web-программирования

Professional Development

32 Qs

Prepare For Testing

Prepare For Testing

Professional Development

32 Qs

15.Articles and Blog

15.Articles and Blog

Professional Development

32 Qs

JavaScript

JavaScript

Professional Development

30 Qs

AI Selection Test

AI Selection Test

Professional Development

29 Qs

Quiz Computer Department-2024

Quiz Computer Department-2024

Professional Development

28 Qs

Kiểm tra giữa kì lập trình Android

Kiểm tra giữa kì lập trình Android

Professional Development

30 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?