About Question enthuware.ocpjp.v7.2.1227 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
D3x!

About Question enthuware.ocpjp.v7.2.1227 :

Post by D3x! »

if str is valid how is obj not valid?

Code: Select all

 final String str = "100"; 
final String obj = "100"; 
public int m3(String a, int b){
         String val = "100";
         Integer iv = 100;
         int i = 100;
         switch(a){
              case  XXXX  : return 1;
          }
         return 0; }

 What can replace XXXX to make the code compile?
"100" and str both are Strings and are compile time constants and are thus valid.

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1227 :

Post by admin »

You are right. It should be : final Object obj = "100";
This has now been fixed.

thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests