Viblo
  • Posts
  • Questions
  • Discussions
Announcements
No announcement yet.
All Announcements

Lê Vũ Quỳnh Trinh

@TrinhLVTQ

Report
  • Posts
  • Series
  • Questions
  • Answers
  • Clips
  • Followings
  • Followers
  • Tags
  • Reputations
  • Communication
Login to comment
Hòa Hào
@tranconghoa
Oct 11th, 2019 5:42 PM

chào chị. chị cho em hỏi bài java này được không ạ

0
| Reply
Share
Close
  • Report
Hòa Hào
@tranconghoa
Oct 11th, 2019 5:50 PM

public static void main(String[] args) { String str; do { str = JOptionPane.showInputDialog("Nhap a:"); try { Integer.parseInt(str); } catch (NumberFormatException num) { JOptionPane.showMessageDialog(null, str, "Nhập Sai Dạng Dữ Liệu", JOptionPane.ERROR_MESSAGE); System.out.println(num); } } while (?); } // e có bài toán nhập 2 số nguyên dùng JoptionPane kiểm tra nhập chữ thì báo lỗi và lặp lại đến khi nhập đúng. e không biết để vào while () tham số kiểm tra như thế nào? cụ thể while (str == "chuoi") thì cho nhập lại nhưng làm sao mà so sánh được như vậy chị nhỉ

0
| Reply
Share
Close
  • Report

Total post views

42.0K

Reputations

874

Following tags

6

Following users

2

Followers

39

Posts

25

Clips

5

Total questions

0

Total answers

0

Organization


Have no organizations yet.

Posts tendency


Resources

  • Posts
  • Organizations
  • Questions
  • Tags
  • Videos
  • Authors
  • Discussions
  • Recommend System
  • Tools
  • Machine Learning
  • System Status

Services

  • Viblo CV Viblo Code
  • Viblo CV Viblo CV
  • Viblo CTF Viblo CTF
  • Viblo Learning Viblo Learning

Mobile App

Get it on Google Play Download on the App Store
QR code

Links

  • Atom Icon

© 2021 Viblo. All rights reserved.

  • About Us
  • Feedback
  • Help
  • FAQs
  • RSS
  • Terms
  • DMCA.com Protection Status