Exam Objectives
Write code that declares, constructs, and initializes arrays of any base type using any of the permitted forms, both for declaration and for initialization.Declare...
Arrays
An array is a data structure that defines an indexed collection of a fixed number of homogeneous data elements. This means that all elements in...
4.1
Given the following declaration, which expression returns the size of the array, assuming the array has been initialized?
int[] array;
Select the one correct answer.
array[].length()array.length()array[].lengtharray.lengtharray[].size()array.size()4.2
Is it possible...
Defining Classes
A class declaration introduces a new reference type. It has the following general syntax:
<class modifiers> class <class name> <extends clause> <implements clause> // Class header{ // Class body <field declarations> <method declarations> <nested class declarations> <nested interface declarations> <constructor declarations> <initializer blocks>}
In the class header, the name...
The general syntax of a method declaration is
<method modifiers> <return type> <method name> (<formal parameter list>) <throws clause> // Method prototype{ // Method body <local variable declarations> <nested local class declarations> <statements>}
In addition to the name of the method, the method prototype can specify...
Java provides explicit accessibility modifiers to control the accessibility of members in a class by external clients (see Section 4.9, p. 137), but in two...
A package in Java is an encapsulation mechanism that can be used to group related classes, interfaces, and subpackages.
Figure shows an example of a package...
Top-level classes and interfaces within a package can be declared as public. This means that they are accessible from everywhere, both inside and outside of...
Modifiers abstract and final can be applied to top-level and nested classes.
abstract Classes
A class can be specified with the keyword abstract to indicate that...
4.14
Given the following class, which of these are valid ways of referring to the class from outside of the package net.basemaster?
package net.basemaster;
public class Base {...
By specifying member accessibility modifiers, a class can control what information is accessible to clients (i.e., other classes). These modifiers help a class to define...
4.17
Given the following definition of a class, which fields are accessible from outside the package com.corporation.project?
package com.corporation.project;
public class MyClass {...
Certain characteristics of fields and/or methods can be specified in their declarations by the following keywords:
staticfinalabstractsynchronizednativetransientvolatile
static Members
The declaration of static members is prefixed by...
4.20
Which statements are true about the use of modifiers?
Select the two correct answers.
If no accessibility modifier (public, protected, and private) is specified for a member...
Chapter Summary
The following information was included in this chapter:
explanation of declaration, construction, initialization, and usage of both one- and multi-dimensional arrays, including anonymous arraysdefining classesdefining...
AJAX popular information C# language guides Windows books and cookbooks
.......
С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.