Java Certification I Exam Questions & Answers 100% Correct!!
12 views 0 purchase
Course
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 ...
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
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.
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
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
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
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 $13.99. You're not tied to anything after your purchase.