Packages + java-visual

Packages + java-visual

Professional Development

84 Qs

quiz-placeholder

Similar activities

Abstraction-visual

Abstraction-visual

Professional Development

80 Qs

SECOND LANGUAGE METHODOLOGIES

SECOND LANGUAGE METHODOLOGIES

Professional Development

83 Qs

Learning Environments competencia

Learning Environments competencia

Professional Development

89 Qs

Computer Essentials

Computer Essentials

Professional Development

87 Qs

Topic 2: Question Set 2-Microsoft PL-300 Exam

Topic 2: Question Set 2-Microsoft PL-300 Exam

Professional Development

82 Qs

Law MCQ SET 1

Law MCQ SET 1

Professional Development

80 Qs

Jan 3rd week

Jan 3rd week

Professional Development

79 Qs

CRIM 4

CRIM 4

Professional Development

79 Qs

Packages + java-visual

Packages + java-visual

Assessment

Quiz

Education

Professional Development

Hard

Created by

ANIL KUMAR

FREE Resource

84 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following classes is part of the java.awt package?

System

String

ArrayList

Button

Answer explanation

The correct answer is Button. The java.awt package contains classes that are used to create graphical user interfaces (GUIs). The Button class is a subclass of the Component class, and it is used to create buttons in a GUI. The other classes in the image are not part of the java.awt package.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following packages is the default package in the image?

default package

Hellojava

rest

SpringJSONRest Test

Answer explanation

The correct answer is default package. The default package is the package that is used when you do not specify a package name for your Java class. In the image, the RestletServer.java and RestletClient.java files do not have a package name specified, so they are part of the default package. The Hellojava and rest packages are both explicitly specified in the image, and the SpringJSONRest Test package is not a real package.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following statements about packages in Java is NOT true?

Packages are used to organize Java classes and interfaces.

Packages can be used to control access to Java classes and interfaces.

Packages can be used to prevent name clashes between Java classes and interfaces.

Packages are a required part of the Java language.

Answer explanation

The correct answer is Packages are a required part of the Java language. Packages are not a required part of the Java language. You can write Java programs without using packages, but you will not be able to take advantage of the benefits of packages, such as organization, access control, and name clashes.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which line of code indicates to the compiler that the Person class belongs to the personpackage package?

package personpackage;

public class Person

private String firstName;

public String getFirstName()

Answer explanation

The correct answer is package personpackage;. The package statement is used to indicate to the compiler which package a Java class belongs to. In the image, the package personpackage; statement is on the first line of the Person.java file, which indicates that the Person class belongs to the personpackage package.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following classes is part of the java.lang package?

System

String

ArrayList

Button

Answer explanation

The correct answer is System. The java.lang package is the default package in Java, and it contains classes that are fundamental to the language, such as System and String. The other classes in the image are part of the util and awt packages.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following is the most common type of built-in package in Java?

java.lang

java.util

java.awt

Answer explanation

The correct answer is java.lang. The java.lang package is the default package in Java, and it contains classes that are fundamental to the language, such as System, String, and Object. The other packages in the image are all useful, but they are not as fundamental as the java.lang package.

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following packages is not a sub-package of java.util?

concurrent

logging

collections

concurrency.concurrent

Answer explanation

The correct answer is concurrency.concurrent. The concurrency package is a sub-package of the java.util package, but the concurrency.concurrent package is not. The concurrency.concurrent package is a nested package, which is a special type of sub-package that is created by putting a period between the names of the packages.

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?