- Declare Classes & Interfaces
- Develop Interfaces & Abstract Classes
- Use Primitives, Arrays, Enums, & Legal Identifiers
- Use Static Methods, JavaBeans Naming, & Var-Args
The objective says you have to know legal identifiers only for variable names, but the rules are the same for All Java components. So remember that a legal identifier for a variable is also a legal identifier for a method or a class. However, you need to distinguish between legal identifiers and naming conventions, such as the JavaBeans standards, that indicate how a Java Component should be named. In other words, you must be able to recognize that an identifier is legal even if it doesn't conform to naming standards. If the exam question is asking about naming conventions-not just whether an identifier will compile-JavaBeans will be mentioned explicitly.
Look for interface definitions that define constants, but without explicitly using the required modifiers. For example, the following are all identical:
java 代码
- public int x = 1;
- int x = 1;
- static int x = 1;
- final int x = 1;
- public static int x = 1;
- public final int x = 1;
- static final int x = 1;
- public static final int x = 1;
Any combination of the required (but implicit) modifiers is legal, as is using no modifiers at all! On the exam, you can expect to see questions you won't be able to answer correctly unless you know, for example, that an interface variable is final and can never be given a value by the implementing (or any other) class.
It is never legal to include the size of the array in your declaration. Yes, we know you can do that in some other languages, which is why you might see a question or two that include code similar to the following:
java 代码
The preceding code won't compile. Remember, the JVM doesn't allocate space until you actually instantiate the array object. That's when size matters.
分享到:
相关推荐
* Declarations and access control * Object orientation * Assignments * Operators * Strings and arrays * Flow control and exceptions * Assertions and Java 7 exceptions * String processing, data ...
In the first chapter, the focus is on understanding declarations and access control within Java. Key concepts include: - **Variable Declarations**: This section covers the basics of declaring ...
Chapter 1: A Tutorial Introduction Getting Started Variables and Arithmetic Expressions The for statement Symbolic Constants Character Input and Output File Copying Character Counting Line ...
Declarations, access control, and enums Object orientation Assertions and exceptions Dates, times, locales, and resource bundles I/O and NIO Generics and collections Inner classes Lambda expressions ...
- **Access Control:** Use private, protected, and public access specifiers appropriately. Consider using friend functions/classes sparingly. - **Declaration Order:** Place variable and function ...
• Access control • Object orientation • Assignments • Operators • Flow control • Exceptions • Strings • Arrays • ArrayLists CD ICON Electronic content includes: • 200+ practice ...
Pointers to Structures 5.7 - Sample Programs 5.7.1 - Simple Variable Declarations 5.7.2 - Using Pointer Variables 5.7.3 - Single Dimension Array Access 5.7.4 - Multidimensional Array ...
output trace mechanism and has a much larger code and data size. Previous Release: Non-Debug Version: 78.1K Code, 17.1K Data, 95.2K Total Debug Version: 155.4K Code, 63.1K Data, 218.5K Total ...
Control Flow Statements and Blocks If-Else Else-If Switch Loops - While and For Loops - Do-While Break and Continue Goto and labels <br>Chapter 4: Functions and ...
instant access to the Borland forums with their libraries of technical information and answers to common questions. If you are not a member of CompuServe, see the enclosed special offer, and ...
Beginning through intermediate-level programmers will benefit from the accessible style of C# 5.0 Programmer’s Reference and will have access to its comprehensive range of more advanced topics....
instant access to the Borland forums with their libraries of technical information and answers to common questions. If you are not a member of CompuServe, see the enclosed special offer, and ...
•Q581933 - At design time, modifying any property of a control selected on the parent form selects a control on an inherited form if the parent form contains TdxWizardControl and/or ...
Forward Declarations, Compiling and Linking Copy Constructor and Object Cloning Class Member Access Class member offsets Function Pointers Function Shadowing Understanding the Destructor Operator ...
14.2 Global-Variable Declarations 131 14.3 Non-Global Environments 132 15 Modules and Packages 137 15.1 The require Function 138 15.2 The Basic Approach for Writing Modules 141 15.3 Using ...
#### 一、声明与访问控制 (Declarations and Access Control) 在SCJP认证考试中,考生需要掌握以下知识点: - **数组的声明与初始化**:能够编写代码来声明、构造并初始化任何基本类型的数组,包括使用所有允许的...
- **Statements:** Covers different types of statements, including assignment, conditional, loops, and control flow. - **Software Engineering: Debugging:** Emphasizes debugging techniques and tools. - ...
8)....Fixed: Removed some unnecessary file system access on startup 9)....Fixed: Possible wrong font size in EurekaLog tools 10)..Fixed: Ignore timeouts from Shell_NotifyIcon 11)..Fixed: Possible ...