<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>4 - Ham Học Hỏi - Java chiều 16/10 by Trung Đức Trọng</title>
      <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2021-10-16 06:16:54 UTC</pubDate>
      <lastBuildDate>2025-10-15 05:41:00 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Câu 5: Break, Continue</title>
         <author>trungductrongg</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820803505</link>
         <description><![CDATA[<div><strong>Từ khóa break trong java</strong> được sử dụng để dừng thực thi lệnh trong vòng lặp hoặc trong mệnh đề switch tại điều kiện đã được chỉ định. Đối với vòng lặp bên trong vòng lặp khác, thì nó chỉ stop vòng lặp bên trong đó.<br>ví dụ:&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;</div><pre>class QLSV {
    public static void main(String[] args) {
      
        for (int i = 1; i &lt;= 10; ++i) {
 
            if (i &gt; 4) {
                break;
            }      
            System.out.println("qua mon");
        }   
    }
}</pre><div><br><br><strong>Từ khóa continue trong java</strong> được sử dụng để tiếp tục vòng lặp tại điều kiện đã được xác định. Với điều kiện đó khối lệnh phía sau từ khóa continue sẽ không được thực thi. Đối với vòng lặp bên trong một vòng lặp khác, continue chỉ có tác dụng với vòng lặp bên trong đó.<br><br>ví dụ:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><pre>class QLSV {
    public static void main(String[] args) {
      
        for (int i = 1; i &lt;= 10; ++i) {

            if (i &gt; 4 &amp;&amp; i &lt; 9) {
                continue;
            }      
            System.out.println(i);
        }   
    }
}</pre>]]></description>
         <enclosure url="https://scontent.fdad2-1.fna.fbcdn.net/v/t1.15752-9/243376634_1248870992251788_1085679083362023877_n.png?_nc_cat=111&amp;ccb=1-5&amp;_nc_sid=ae9488&amp;_nc_ohc=yJVpgyI96QIAX9knHMf&amp;tn=-FHavS6WjQcnrH5M&amp;_nc_ht=scontent.fdad2-1.fna&amp;oh=3ab33bc85a8ae822b6bacaea46fd2edd&amp;oe=618E76AC" />
         <pubDate>2021-10-16 06:24:18 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820803505</guid>
      </item>
      <item>
         <title>ĐỀ TÀI: QUẢN LÍ SINH VIÊN IT</title>
         <author>ptht101002</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820808718</link>
         <description><![CDATA[<div>&nbsp;   <strong>PHÂN CÔNG CÔNG VIỆC</strong></div><div>Câu 1: Nguyễn Thị Hồng Nhung<br>Câu 2: Đặng Thị Phương Lan<br>Câu 3: Phạm Thị Hồng Thắm<br>Câu 4: Nguyễn Văn Tuyên<br>Câu 5: Trung Đức Trọng</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758727/48897b7afafd10fdbbb940b49a3f5221/phan_chia_nhiem_vu_cho_thanh_vien.png" />
         <pubDate>2021-10-16 06:34:01 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820808718</guid>
      </item>
      <item>
         <title>Câu 3: Cú pháp và cách sử dụng cấu trúc FOR?</title>
         <author>ptht101002</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820809918</link>
         <description><![CDATA[<div><strong>Cú pháp:</strong><br>&nbsp; &nbsp;<strong><em>&nbsp;for (&lt;khởi tạo biến chạy&gt;;&lt;Biểu thức điều kiện&gt;;&lt;thay đổi&nbsp; &nbsp; &nbsp; biến chạy&gt;) {</em></strong></div><div><strong><em>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Khối lệnh lặp lại&gt;</em></strong></div><div><strong><em>&nbsp; &nbsp; &nbsp;}</em></strong><strong><br>Cách sử dụng: </strong><br><em>public void nhapDanhSachSinhVien() {<br>&nbsp; &nbsp; &nbsp; &nbsp; Scanner sc = new Scanner(System.in);</em></div><div><em>&nbsp; &nbsp; &nbsp; &nbsp; Student sv;<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Nhap so luong sinh vien: ");<br>&nbsp; &nbsp; &nbsp; &nbsp; int n = sc.nextInt();<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Nhap danh sach sinh vien: ");<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; n; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Sinh vien thu " + (i + 1) + " la:");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sv = new Student();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sv.nhapThongTin();<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }</em><strong><br>&nbsp; &nbsp; &nbsp; &nbsp;</strong></div><div><strong><br><br><br></strong><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758727/b62dd1fb15aa65771d3dff2b033a0763/vong_lap_for_trong_java_1024x536.jpg" />
         <pubDate>2021-10-16 06:36:40 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820809918</guid>
      </item>
      <item>
         <title>Câu 4: DO WHILE</title>
         <author>nvtuyen10102002</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820817698</link>
         <description><![CDATA[<div><br></div><pre><strong>Vòng lặp do-while trong java</strong> được sử dụng để lặp một phần của chương trình một vài lần. Tương tự như vòng lặp while, ngoại trừ do-while thực hiện lệnh ít nhất một lần ngay cả khi điều kiện là False.
<strong>Cú pháp:</strong>
<strong>do</strong> {  
    // Khối lệnh được thực thi
} <strong>while</strong>(condition);  
<strong>Ví dụ:</strong>
public static void main(String[] args) {
    double diemheso10=-5 ;
    Scanner sc=new Scanner(System.<em>in</em>);
    do
    {
        System.<em>out</em>.print("Nhập điểm hệ số 10: ");
        diemheso10=sc.nextDouble();
    }while(diemheso10&lt;0|| diemheso10&gt;10);
    System.<em>out</em>.println("Điểm hệ số 10: "+diemheso10);
}</pre><div><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367757129/5014e359ee57f17369906e2ddfa8b656/image.png" />
         <pubDate>2021-10-16 06:51:35 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820817698</guid>
      </item>
      <item>
         <title>Câu 1: Cấu trúc câu điều kiện If</title>
         <author>3120220120</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820823490</link>
         <description><![CDATA[<div><strong>1.Cấu trúc rẽ nhánh là gì? Phân loại?</strong></div><div>- Trong lập trình, có những lúc ta cần phân chia các trường hợp và mỗi hoàn cảnh sẽ thực hiện những đoạn chương trình khác nhau. Như vậy dựa vào điều kiện ta sẽ rẽ nhánh cho chương trình chạy câu lệnh tương ứng.<br><br></div><div>- Phân loại: Có 2 loại cấu trúc rẽ nhánh là <strong>dạng thiếu</strong> và <strong>dạng đủ.<br><br>2.Cách sử dụng cấu trúc rẽ nhánh:<br>a.Cấu trúc rẽ nhánh dạng thiếu:</strong></div><div><strong><mark>*</mark></strong><mark>Cú pháp:</mark></div><blockquote><strong>if</strong> (<strong>&lt;Biểu thức điều kiện&gt;</strong>) <strong>&lt;Câu lệnh thực hiện&gt;</strong></blockquote><div><br><strong>*Ý nghĩa:&nbsp;</strong></div><div>- Nếu <strong>&lt;Biểu thức điều kiện&gt;</strong> trả về <strong>true </strong>thì sẽ thực hiện <strong>&lt;Câu lệnh thực hiện&gt;</strong>.<br><br><strong><mark>*</mark></strong><mark>Ví dụ: </mark><br><strong>public</strong> <strong>class</strong> QLSV{<br>&nbsp; &nbsp; &nbsp;<strong>public</strong> <strong>static</strong> <strong>void</strong> <strong>main</strong>(String []args){<br>&nbsp; &nbsp; &nbsp; &nbsp; String name = "sinh viên";<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>if</strong> (name == "sinh viên") <br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Danh sách sinh viên");<br>&nbsp; &nbsp; &nbsp;}<br>}<br><br><strong>b.Cấu trúc rẽ nhánh dạng đủ:<br>- </strong>Dạng đủ sẽ chia ra 2 loại: Gồm<strong> if..else..</strong> và <strong>if..else if..else..<br></strong><br></div><div><strong><em>**Dạng if..else..</em></strong><strong><br></strong><br></div><div><mark>*</mark><strong><mark>Cú pháp:</mark></strong></div><blockquote><strong>if </strong>(<strong>&lt;Biểu thức điều kiện&gt;</strong>)<br><br>&lt;Câu lệnh thực hiện điều kiện đúng&gt;<br><br><strong>else<br></strong><br>&lt;Câu lệnh thực hiện điều kiện sai&gt;</blockquote><div><br><strong><mark>*Ý nghĩa:</mark></strong></div><div>- Nếu <strong>&lt;Biểu thức điều kiện&gt;</strong> trả về <strong>true </strong>thì sẽ thực hiện &lt;Câu lệnh thực hiện điều kiện đúng&gt;. Ngược lại nếu trả về <strong>false</strong> sẽ thực hiện &lt;Câu lệnh thực hiện điều kiện sai&gt;<br><br><mark>*</mark><strong><mark>Ví dụ:</mark></strong><strong><br>public</strong> <strong>class</strong> QLSV{<br>&nbsp; &nbsp; &nbsp;<strong>public</strong> <strong>static</strong> <strong>void</strong> <strong>main</strong>(String []args){<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>int</strong> tbDiemhe4 ;<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>if</strong> (tbDiemhe4 &gt;=2)<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Không bị rút tín chỉ");<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>else</strong><br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Bị rút tín chỉ);<br>&nbsp; &nbsp; &nbsp;}<br>}<br><br><em>**</em><strong><em>Dạng if..else if..else<br></em></strong><br></div><div><mark>*</mark><strong><mark>Cú pháp:</mark></strong></div><blockquote><strong>if </strong>(<strong>&lt;Biểu thức điều kiện 1&gt;</strong>)<br><br>&lt;Câu lệnh thực hiện điều kiện 1&gt;<br><br><strong>else if</strong> (<strong>&lt;Biểu thức điều kiện 2&gt;</strong>)<br><br>&lt;Câu lệnh thực hiện điều kiện 2&gt;<br><br>(Nhiều câu điều kiện khác nếu cần)<br><br><strong>else<br></strong><br>&lt;Câu lệnh thực hiện không đúng trong tất các điều kiện trên&gt;</blockquote><div><br><mark>*</mark><strong><mark>Ý nghĩa:</mark></strong></div><div>- Đây là dạng cấu trúc rẽ nhiều nhánh nếu ta muốn xét nhiều trường hợp để thực hiện rõ ràng hơn.<br><br></div><div><mark>*</mark><strong><mark>Ví dụ:</mark></strong><strong><br>public</strong> <strong>class</strong> <strong>QLSV</strong>{<br>&nbsp; &nbsp; &nbsp;<strong>public</strong> <strong>static</strong> <strong>void</strong> <strong>main</strong>(String []args){<br>&nbsp; &nbsp; &nbsp; &nbsp; String job = "Sinh viên";<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>if</strong> (job == "Học sinh")<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Bạn còn lứa tuổi học sinh");<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>else</strong> <strong>if</strong> (job == "Sinh viên")<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Sinh viên có thể tham gia");<br>&nbsp; &nbsp; &nbsp; &nbsp; <strong>else</strong><br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.print("Không rõ công việc của bạn");<br>&nbsp; &nbsp; &nbsp;}<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367762454/e9f63460796bc63a0995661754c32fd4/cau_truc_dieu_khien_if_else_trong_java.jpg" />
         <pubDate>2021-10-16 07:01:54 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820823490</guid>
      </item>
      <item>
         <title>câu 2: cấu trúc SWITCH...CASE</title>
         <author>3120220099</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820823691</link>
         <description><![CDATA[<div><br><strong>1.Cấu trúc lệnh:</strong><br>switch (bieu_thuc) {&nbsp; &nbsp; <br>case gia_tri_1:<br>&nbsp; &nbsp; // Khối lệnh 1<br>&nbsp; &nbsp; break;&nbsp; //tùy chọn<br>case gia_tri_2:&nbsp; &nbsp; <br>&nbsp; &nbsp; // Khối lệnh 2<br>&nbsp; &nbsp; break;&nbsp; //tùy chọn<br>......&nbsp; &nbsp; <br>case gia_tri_n:&nbsp; &nbsp; <br>&nbsp; &nbsp; // Khối lệnh n<br>&nbsp; &nbsp; break;&nbsp; //tùy chọn&nbsp; &nbsp; <br>default:&nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; // Khối lệnh này được thực thi <br>&nbsp; &nbsp; // nếu tất cả các điều kiện trên không thỏa mãn <br>}<br><strong>2.Hoạt động của switch case như sau:</strong><br><br><br></div><ul><li>Switch sẽ kiểm tra giá trị của biến variable (nằm trong ngoặc đơn sau switch kia), và so sánh biến với từng giá trị khác nhau, lần lượt từ trên xuống dưới, mỗi giá trị cần so sánh gọi là một case.</li></ul><div><br><strong>3.Ví dụ:</strong><br>Scanner sc&nbsp; = new Scanner(System.in);<br>byte menu = Byte.parseByte(sc.nextLine());<br>	switch(menu) {<br>		case 1:<br>			//nhập dữ liệu sinh viên<br>			break;<br>		case 2:<br>			//in ra dữ liệu sinh viên<br>			break;<br>		case 3:<br>			//Tìm&nbsp; kiếm<br>			break;<br>		default:<br>			//nhập lại<br>			break;<br>		}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367762665/1007e508f8519a2bbbf777c5a86140ab/image.png" />
         <pubDate>2021-10-16 07:02:23 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820823691</guid>
      </item>
      <item>
         <title>Câu 4: WHILE</title>
         <author>nvtuyen10102002</author>
         <link>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820827477</link>
         <description><![CDATA[<pre><strong>Vòng lặp while trong java</strong> được sử dụng để lặp một phần của chương trình một vài lần. Nếu số lần lặp không được xác định trước thì vòng lặp lặp while được khuyến khích sử dụng trong trường hợp này.
<strong>Cú pháp</strong>: 
<strong>while</strong>(condition) {  
    // Khối lệnh được lặp lại cho đến khi condition = False
}  
<strong>Ví dụ</strong>:
public static void main(String[] args) {
    ArrayList dsdiem10=new ArrayList();
    double diemheso10=-5 ;
    Scanner sc=new Scanner(System.<em>in</em>);
    for (int i =0  ;i&lt;5;i++){
    do
    {
        System.<em>out</em>.print("Nhập điểm hệ số 10: ");
        diemheso10=sc.nextDouble();
    }while(diemheso10&lt;0|| diemheso10&gt;10);
    dsdiem10.add(diemheso10);}
    System.<em>out</em>.println("Mời bạn nhập khoảng điểm cần tìm: ");
    double a,b;
    System.<em>out</em>.print("Điểm đầu: ");
    a=sc.nextDouble();
    System.<em>out</em>.print("Điểm cuối: ");
    b= sc.nextDouble();
    System.<em>out</em>.println(dsdiem10.get(0));
    double c=0;
    if (a&gt;b) {
        c = a;
        a=b;
        b=c;
    }
    System.<em>out</em>.println("Điểm từ "+a+" đến" +b+":");
    int i=0;
    while (i&lt;dsdiem10.size())
    {
         c=(double) dsdiem10.get(i);
        if (c&gt;a&amp;&amp;c&lt;b)
            System.<em>out</em>.println(dsdiem10.get(i));
    i++;
    }
}
<br></pre><div><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367757129/fe1daad9e367dbebd0e9d8208d24fdfa/image.png" />
         <pubDate>2021-10-16 07:09:00 UTC</pubDate>
         <guid>https://padlet.com/trungductrongg/d5dqvxl8ak48t0ub/wish/1820827477</guid>
      </item>
   </channel>
</rss>
