Oracle 1Z0-804 (Java SE 7 Programmer II Exam) 시험대비덤프를 찾고 계시다면 Pass4Test가 제일 좋은 선택입니다.저희 Pass4Test에서는 여라가지 IT자격증시험에 대비하여 모든 과목의 시험대비 자료를 발췌하였습니다. Pass4Test에서 Oracle 1Z0-804 (Java SE 7 Programmer II Exam) 시험대비덤프자료를 구입하시면 시험불합격시 덤프비용환불신청이 가능하고 덤프 1년 무료 업데이트서비스도 가능합니다. Pass4Test를 선택하시면 후회하지 않을것입니다.
NO.1 Given this error message when running your application:
Exception in
thread "main" java.util.MissingResourceException: Can't find bundle for base
name
MessageBundle, locale
And given that the MessageBundle.properties
file has been created, exists on your disk, and is
properly
formatted.
What is the cause of the error message?
A. The file is not in
the environment path.
B. The file is not in the classpath.
C. The file is
not in the javapath.
D. You cannot use a file to store a
ResourceBundle.
Answer: D
NO.2 Give:
Class Employee {
public int
checkEmail() {/* . . . */}
public void sendEmail (String email) {/* . . .
*/}
public Boolean validDateEmail(){/* . . . */}
public void printLetter
(String letter) {/* . . . */}
}
Which is correct?
A. Employee takes
advantage of composition.
B. Employee "has-an" Email.
C. Employee "is-a"
LetterPrinter.
D. Employee has low cohesion.
Answer: D
NO.3 Given
the code fragment:
public class App {
public static void main (String []
args){
Path path =
Paths.get("C:\\education\\institute\\student\\report.txt");
System.out.println("get.Name(0):
%s", path.getName(0));
System.out.println ("subpath(0, 2): %s", path.subpath
(0, 2));}
}
What is the result?
A. getName (0): C:\
subpath (0, 2):
C:\education\report.txt
B. getName(0): C:\
subpth(0, 2):
C:\education
C. getName(0): education
subpath (0, 2):
education\institute
D. getName(0): education
subpath(0, 2):
education\institute\student
E. getName(0): report.txt
subpath(0, 2):
insritute\student
Answer: C
Explanation: Example:
Path path =
Paths.get("C:\\home\\joe\\foo");
getName(0)
->
home
subpath(0,2)
Reference: The Java Tutorial, Path
Operations
NO.4 Which two codes correctly represent a standard language
locale code?
A. ES
B. FR
C. U8
D. Es
E. fr
F. u8
Answer:
A,D
NO.5 Given the fragment:
public class CustomerApplication
{
public static void main (String args[]) {
CustomerDAO custDao= new
CustomerDAOMemoryImpl(); // Line 3
// o t he r m e t hod
}
}
Which
two valid alternatives to line 3 would decouple this application from a
specific
implementation of CustomerDAO?
A. CustomerDAO custDao =
CustomerDAO();
B. CustomerDAO custDao = (CustomerDAO) new Object ();
C.
CustomerDAO custDao = CustomerDAO.getInstance();
D. CustomerDAO custDao =
(CustomerDAO) new CustomerDAOmemoryImp1();
E. CustomerDAO custDao =
customerDAOFactory.getInstance();
Answer: B,E
NO.6 Given the existing
destination file, a source file only 1000 bytes long, and the code
fragment:
public void process (String source, String destination) {
try
(InputStream fis = new FileInputStream(source);
OutputStream fos = new
FileOutputStream(destination)
) {
byte [] buff = new byte[2014];
int
i;
while ((i = fis.read(buff)) != -1) {
fos.write(buff,0,i); // line
***
}
} catch (IOException e)
{
System.out.println(e.getClass());
}
}
What is the result?
A.
Overrides the content of the destination file with the source file content
B.
Appends the content of the source file to the destination file after a new
line
C. Appends the content of the source file to the destination file
without a break in the flow
D. Throws a runtime exception at
line***
Answer: A
NO.7 Given:
class Deeper {
public Number
getDepth() {
return 10;
}
}
Which two classes correctly override the
getDepth method?
A. public class deep extends Deeper {
protected integer
getDepth(){
return 5;
}
}
B. public class deep extends Deeper
{
public double getDepth() {
return"5";
}
}
C. public class deep
extends Deeper {
public String getDepth () {
}
}
D. public class
deep extends Deeper {
public Long getDepth (int d) {
return
5L;
}
}
E. public class deep extends Deeper {
public short getDepth
() {
return 5;
}
}
Answer: A,E
NO.8 Given the code
fragment:
DataFormat df;
Which statement defines a new Dateformat object
that displays the default date format for the UK
Locale?
A. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));
B. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, UK);
C. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
E. df = new
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));
Answer:
C
Exception in
thread "main" java.util.MissingResourceException: Can't find bundle for base
name
MessageBundle, locale
And given that the MessageBundle.properties
file has been created, exists on your disk, and is
properly
formatted.
What is the cause of the error message?
A. The file is not in
the environment path.
B. The file is not in the classpath.
C. The file is
not in the javapath.
D. You cannot use a file to store a
ResourceBundle.
Answer: D
NO.2 Give:
Class Employee {
public int
checkEmail() {/* . . . */}
public void sendEmail (String email) {/* . . .
*/}
public Boolean validDateEmail(){/* . . . */}
public void printLetter
(String letter) {/* . . . */}
}
Which is correct?
A. Employee takes
advantage of composition.
B. Employee "has-an" Email.
C. Employee "is-a"
LetterPrinter.
D. Employee has low cohesion.
Answer: D
NO.3 Given
the code fragment:
public class App {
public static void main (String []
args){
Path path =
Paths.get("C:\\education\\institute\\student\\report.txt");
System.out.println("get.Name(0):
%s", path.getName(0));
System.out.println ("subpath(0, 2): %s", path.subpath
(0, 2));}
}
What is the result?
A. getName (0): C:\
subpath (0, 2):
C:\education\report.txt
B. getName(0): C:\
subpth(0, 2):
C:\education
C. getName(0): education
subpath (0, 2):
education\institute
D. getName(0): education
subpath(0, 2):
education\institute\student
E. getName(0): report.txt
subpath(0, 2):
insritute\student
Answer: C
Explanation: Example:
Path path =
Paths.get("C:\\home\\joe\\foo");
getName(0)
->
home
subpath(0,2)
Reference: The Java Tutorial, Path
Operations
NO.4 Which two codes correctly represent a standard language
locale code?
A. ES
B. FR
C. U8
D. Es
E. fr
F. u8
Answer:
A,D
NO.5 Given the fragment:
public class CustomerApplication
{
public static void main (String args[]) {
CustomerDAO custDao= new
CustomerDAOMemoryImpl(); // Line 3
// o t he r m e t hod
}
}
Which
two valid alternatives to line 3 would decouple this application from a
specific
implementation of CustomerDAO?
A. CustomerDAO custDao =
CustomerDAO();
B. CustomerDAO custDao = (CustomerDAO) new Object ();
C.
CustomerDAO custDao = CustomerDAO.getInstance();
D. CustomerDAO custDao =
(CustomerDAO) new CustomerDAOmemoryImp1();
E. CustomerDAO custDao =
customerDAOFactory.getInstance();
Answer: B,E
NO.6 Given the existing
destination file, a source file only 1000 bytes long, and the code
fragment:
public void process (String source, String destination) {
try
(InputStream fis = new FileInputStream(source);
OutputStream fos = new
FileOutputStream(destination)
) {
byte [] buff = new byte[2014];
int
i;
while ((i = fis.read(buff)) != -1) {
fos.write(buff,0,i); // line
***
}
} catch (IOException e)
{
System.out.println(e.getClass());
}
}
What is the result?
A.
Overrides the content of the destination file with the source file content
B.
Appends the content of the source file to the destination file after a new
line
C. Appends the content of the source file to the destination file
without a break in the flow
D. Throws a runtime exception at
line***
Answer: A
NO.7 Given:
class Deeper {
public Number
getDepth() {
return 10;
}
}
Which two classes correctly override the
getDepth method?
A. public class deep extends Deeper {
protected integer
getDepth(){
return 5;
}
}
B. public class deep extends Deeper
{
public double getDepth() {
return"5";
}
}
C. public class deep
extends Deeper {
public String getDepth () {
}
}
D. public class
deep extends Deeper {
public Long getDepth (int d) {
return
5L;
}
}
E. public class deep extends Deeper {
public short getDepth
() {
return 5;
}
}
Answer: A,E
NO.8 Given the code
fragment:
DataFormat df;
Which statement defines a new Dateformat object
that displays the default date format for the UK
Locale?
A. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));
B. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, UK);
C. df =
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
D. df = new
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale.UK);
E. df = new
DateFormat.getdatDataInstance (DateFormat.DEFAULT, Locale (UK));
Answer:
C