100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Java Certification I Exam Questions & Answers 100% Correct!! £11.42   Add to cart

Exam (elaborations)

Java Certification I Exam Questions & Answers 100% Correct!!

 13 views  0 purchase
  • Module
  • Java Certification I
  • Institution
  • Java Certification I

Package - ANSWERAll java classes are part of a package. 1) It must be the first statement in a class. 2) Classes and interfaces in the same package can use each other without prefixing their names with the package name. 3) To use a class or interface from another package must use a full, qualified ...

[Show more]

Preview 3 out of 19  pages

  • August 2, 2024
  • 19
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • Java Certification I
  • Java Certification I
avatar-seller
Java Certification I Exam Questions & Answers
100% Correct!!

Package - ANSWERAll java classes are part of a package. 1) It must be the first statement in a class. 2)
Classes and interfaces in the same package can use each other without prefixing their names with
the package name. 3) To use a class or interface from another package must use a full, qualified
name (unless imported). 4) Should be the first line of a class file unless preceded by a Comment

4) applies to all classes/interfaces in class file

5) lower case names

6) separated from subs by dot

7) one package statement per java source file

8) only comment can precede

p. 16, 23, 31



Default package - ANSWER1) If a class does not start with the name of a package it is part of the
unnamed "Default package".

2) Automatically imported in classes and interfaces in the same directory

3) A class from a default package can't be used in a named package class whether in same directory
or not

p. 16, 36



Import statement - ANSWER1) Use a class or interface in another package without the fully qualified
name, p.16

2) Follows package statement and precedes class declaration

3) applies to all classes/interfaces in source file

4) cant use to access classes/interfaces of same name from different packages, e.g., java.util.Date
and java.sql.Date.

5) can import single class/interface or all.

6) use asterisk to import all public members, classes, interfaces

7) asterisk doesn't recursively import classes from subpackage



package university;

,import certification.ExamQuestion;

class AnnualExam {

ExamQuestion eq;

}

p. 34-36



Compile Failures - Package statement - ANSWER1) Package statement at end of class definition; 2)
package statement within class definition; 3) multiple package statements for class

p. 16



Compile Failures - Import statement - ANSWER1) Import statement appears before package
statement.

p.17



Comment Location - ANSWERCan appear anywhere in code, including: 1) before package statement;
2) after package statement; 3) before class definition; 4) after class definition; 5) before method
definition; 6) after method definition; 7) within method definition

p. 17



Comment Types - ANSWERSingle line and multi-line

p. 17



Comment - Multi-line - ANSWERBegin: /*

End: */

Notice asterisk in the middle and forward slash on outsides

p. 17



Comment - End-of-line - ANSWERStart with //

p. 18



Class declaration - simple - ANSWERMost simple is keyword "class" followed by class name.

p. 19

, Class declaration - components - ANSWER1) Access modifiers - optional

2) Non-access modifiers - optional

3) "class" keyword – compulsory

native [method] - ANSWER1) Non-access modifier

2) Uses libraries and methods implemented in other program languages, e.g., C++

3) Cannot use with classes, interfaces, variables

p. 48



transient [variable] - ANSWER1) Non-access modifier

2) Is not serialized when corresponding object is serialized

3) Cannot use with classes, interfaces, methods

p. 48



volatile [variable] - ANSWER1) Non-access modifier

2) Value can be safely modified by different threads

3) Cannot use with classes, interfaces, methods

p. 48



strictfp [class, interface, method] - ANSWER1) Non-access modifier

2) Ensure calculations using floating-point number are identical across platforms

3) Can use with classes, interfaces, methods

4) Cannot use with variables

p. 48



Abstract modifier - ANSWER1) Non-access modifier

2) Can use with classes, interfaces, methods

3) Cannot use with variables

p. 48



Abstract class - ANSWER1) Class that cannot be instantiated

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller papersmaster01. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £11.42. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76799 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£11.42
  • (0)
  Add to cart