Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
¿Por qué no hay un error de compilación cuando uso diferentes tipos de datos para cambiar la expresión y el valor del caso en este caso?
public class Conditionsif { public static void main(String[] args) { // TODO Auto-generated method stub int day=1; switch(day){ case '1': System.out.println("Monday"); break; } } }

No hay ningún error de compilación en lo anterior, aunque la expresión de cambio es un tipo de datos entero y el valor del caso es un carácter.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Es debido a que el valor ascii de fundición implícito de a es 97

 switch(97){ case 'a': System.out.println("a"); break; case 'b': System.out.println("b"); break; case 'c': System.out.println("c"); break; }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!