<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Nhóm 5 - Thounsand Sunny - Java chiều 2/10 by Gia Quyền Trần</title>
      <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7</link>
      <description>Được tạo bằng một cơn sáng tạo không ngừng</description>
      <language>en-us</language>
      <pubDate>2021-10-02 06:43:51 UTC</pubDate>
      <lastBuildDate>2024-12-17 06:51:33 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Câu 5: Nêu cách nhập xuất dữ liệu trong Java. Ví dụ.</title>
         <author>doanngocthanh1811002</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785567816</link>
         <description><![CDATA[<div><strong>1)Các phương thức thường dùng nhập xuất trong lớp Scanner:</strong><br> <br> <strong>nextBoolean</strong> | Nhập vào kiểu Boolean ( true – false)<br> <strong>nextByte&nbsp; &nbsp; &nbsp; &nbsp; </strong>| Nhập vào kiểu dữ liệu Byte<br>&nbsp;<strong>nextShort&nbsp; &nbsp; &nbsp; </strong>| Nhập vào kiểu Short<br>&nbsp;<strong>nextInt&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</strong>| Nhập vào kiểu số nguyên từ bàn phím<br>&nbsp;<strong>nextFloat&nbsp; &nbsp; &nbsp; </strong>&nbsp;| Nhập vào kiểu số thực<br>&nbsp;<strong>nextDouble&nbsp; </strong>&nbsp;| Nhập vào kiểu Double ( số thực lớn hơn float)<br>&nbsp;<strong>nextLine&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</strong>| Nhập vào kiểu String ( String giá trị chuỗi)<br>&nbsp;<strong>nextLong&nbsp; &nbsp; &nbsp; &nbsp;</strong>| Nhập vào số nguyên lớn<br>&nbsp;<br>&nbsp;2) <strong>Nhập dữ liệu từ bàn phím.</strong><br> Cách nhập dữ liệu từ bàn phím cũng phải sử dụng theo hướng đổi tượng. Tức là bạn phải khai báo một đối tượng, sau đó gọi hàm nhập, rồi gán giá trị cho biến.<br><br></div><div><strong>Scanner</strong> là một lớp trong thư viện Java.util giúp bạn nhập và lưu data từ bàn phím. Ngoài scanner, còn có nhiều lớp khác nữa, nhưng đây là lớp được sử dụng nhiều nhất.<br> <br> Cách import thư viên ta thêm lệnh:<br> <strong>import java.util.Scanner;</strong><br> <br> Khai báo Scanner ta gõ lệnh như sau:<br> <strong>Scanner sc = new Scanner(System.in);</strong><br> <br> 3<strong>) Xuất dữ liệu từ bàn phím.</strong><br> Xuất dữ liệu của biến mà bạn đã lưu cũng khá quan trọng. Nó show cho bạn kết quả của bài toán, các câu lệnh giúp người dùng tương tác với chương trình.<br><br></div><div>Cú pháp in ra màn hình:<br>&nbsp;System.out.println(“Noi dung can in” + biến);</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367757208/124f1d21f3cd61475bedd0d066c02f5e/MicrosoftTeams_image.png" />
         <pubDate>2021-10-02 06:49:17 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785567816</guid>
      </item>
      <item>
         <title>Câu 4.Toán tử trong Java. Ví dụ</title>
         <author>giaquyentran365</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785570225</link>
         <description><![CDATA[<div><br>1.Toán tử Unary ++ --<br>Các toán tử Unary trong Java chỉ yêu cầu một toán hạng. Toán tử Unary được sử dụng để thực hiện các hoạt động khác nhau, tức là:</div><ul><li>Tăng hoặc giảm giá trị một đơn vị</li><li>Phủ định một biểu thức</li><li>Đảo ngược giá trị của một Boolean</li></ul><div><br>&nbsp; &nbsp;int x = 10, y = 5;<br>&nbsp; &nbsp;System.out.println(y + x++); // 15<br>&nbsp; &nbsp;System.out.println(y + ++x); // 16<br>&nbsp; &nbsp;System.out.println(y + x--); &nbsp; // 15<br>&nbsp; &nbsp;System.out.println(y + --x); &nbsp; // 14<br>&nbsp; &nbsp;15 17 17 15<br><br>2. Toán tử toán học<br>Các Toán tử Toán học trong Java được sử dụng để thực hiện phép cộng, phép trừ, phép nhân và phép chia. Chúng hoạt động như các hoạt động toán học cơ bản.<br><br>&nbsp; &nbsp;int x = 10, y = 5;<br>&nbsp; &nbsp;System.out.println(x + y); // 15<br>&nbsp; &nbsp;System.out.println(x - y);&nbsp; // 5<br>&nbsp; &nbsp;System.out.println(x * y);&nbsp; // 50<br>&nbsp; &nbsp;System.out.println(x / y); &nbsp; // 2<br>&nbsp; &nbsp;System.out.println(x % y); // 0<br><br>3. Toán tử dịch chuyển<br>Toán tử dịch chuyển trái (Left shift Operator) trong Java được sử dụng để dịch chuyển tất cả các bit trong một giá trị sang bên trái theo một số lần được chỉ định.<br>&nbsp; &nbsp;System.out.println(10&lt;&lt;2); // 10*2^2 = 40<br><br>Toán tử dịch chuyển phải trong Java “&gt;&gt;” được sử dụng để di chuyển giá trị toán hạng bên trái sang phải theo số bit được chỉ định bởi toán hạng bên phải.<br>&nbsp;System.out.println(10&gt;&gt;2); // 10/2^2 = 2<br><br>Toán tử &gt;&gt;&gt;<br>System.out.println(20&gt;&gt;&gt;2); // 5<br><br>4. Toán tử AND Logic &amp;&amp; và Bitwise &amp;<br>Toán tử logic &amp;&amp; không kiểm tra điều kiện thứ hai nếu điều kiện thứ nhất là sai. Nó chỉ kiểm tra điều kiện thứ hai nếu điều thứ nhất là đúng.<br><br></div><div>Toán tử bitwise &amp; toán tử luôn kiểm tra cả hai điều kiện cho dù điều kiện đầu tiên là đúng hay sai.<br><br>&nbsp; &nbsp;int x = 10, y = 5;<br>&nbsp; &nbsp;System.out.println(x&gt;y &amp;&amp; x&lt;y); // true &amp;&amp; false&nbsp; = false<br>&nbsp; &nbsp;System.out.println(x&gt;y &amp; x&lt;y);&nbsp; // true &amp; false = false<br><br>5. Toán tử OR: Logic | | Và Bitwise |<br>Toán tử logic | | trong Java không kiểm tra điều kiện thứ hai nếu điều kiện thứ nhất là đúng. Nó chỉ kiểm tra điều kiện thứ hai nếu cái đầu tiên là sai.<br><br></div><div>Các toán tử bit | luôn kiểm tra cả hai điều kiện cho dù điều kiện đầu tiên là đúng hay sai.<br><br></div><div>&nbsp; &nbsp;int x = 10, y = 5;<br>&nbsp; &nbsp;System.out.println(x&gt;y || x&lt;y); // true<br>&nbsp; &nbsp;System.out.println(x&gt;y | x&lt;y);&nbsp; // true<br><br>6. Toán tử Ternary<br>Toán tử Java Ternary được sử dụng như một thay thế cho câu lệnh if-then-other và được sử dụng rất nhiều trong lập trình java. Nó là toán tử có điều kiện duy nhất có ba toán hạng.</div><div>||| Toán tử Ternary hay còn được gọi là Toán tử 3 ngôi<br><br>&nbsp; &nbsp;int x = 10, y = 5;<br>&nbsp; &nbsp;System.out.println(x &gt; y ? x : y); // 10<br><br><br>7. Toán tử gán<br>Toán tử gán Java là một trong những toán tử phổ biến nhất. Nó được sử dụng để gán giá trị ở bên phải của nó cho toán hạng bên trái.<br><br>&nbsp; &nbsp;int x = 10,<br>&nbsp; &nbsp;System.out.println(x+=5); // 15<br>&nbsp; &nbsp;System.out.println(x-=5); // 5<br><br></div><div><br><br><br></div><div><br><br><br><br><br>&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 06:53:29 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785570225</guid>
      </item>
      <item>
         <title>1.Tróng Java có những kiểu dữ liệu nào?Cho ví dụ cụ thể?</title>
         <author></author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785570966</link>
         <description><![CDATA[]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 06:54:52 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785570966</guid>
      </item>
      <item>
         <title>Câu 3.Có bao nhiêu cách ép kiểu trong Java? Cho ví dụ cụ thể.</title>
         <author>3120218008</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785575298</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758500/bb8dc542761f4ccdf4889da78b2d0efc/image.png" />
         <pubDate>2021-10-02 07:02:19 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785575298</guid>
      </item>
      <item>
         <title>Ép kiểu ngầm định: việc ép kiểu này có thể diễn ra một cách tự động bởi hệ thống. Cách này sẽ không làm mất dữ liệu, nhưng chỉ thể ép kiểu từ kiểu nhỏ lên kiểu dữ liệu lớn hơn.</title>
         <author>3120218008</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785575770</link>
         <description><![CDATA[<div><br>&nbsp;VD: <strong>public</strong> <strong>class</strong> MainClass {</div><div>&nbsp;<strong>public</strong> <strong>class</strong> Age {</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(<strong>String</strong>[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>byte</strong> tuoi = 50;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>short</strong> tuoi_1 = tuoi;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>int</strong> tuoi_2= tuoi_1;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Tuoi nhan vien ban dau: " + tuoi);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Tuoi nhan vien sau khi ep thanh kieu  short: " + tuoi_1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Tuoi nhan vien sau khi ep thanh kieu int: " + tuoi_2);</div><div><br></div><div>&nbsp; &nbsp; }</div><div>&nbsp;&nbsp;</div><div>}</div><div>&nbsp; &nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 07:03:06 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785575770</guid>
      </item>
      <item>
         <title>Ép kiểu tường minh: khi ép từ kiểu dữ liệu lớn về nhỏ thì hệ thống sẽ báo lỗi. Nên ta phải chỉ định ép kiểu một cách tường minh. Cách ép kiểu này có thể sẽ làm mất đi giá trị của dữ liệu.</title>
         <author>3120218008</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785577553</link>
         <description><![CDATA[<div><br>&nbsp;VD:</div><div>&nbsp;</div><div>&nbsp; &nbsp;<strong>public</strong> <strong>class</strong> Age {</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(<strong>String</strong>[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>int</strong> tuoi = 50;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>short</strong> tuoi_1= (<strong>short</strong>) tuoi;</div><div>&nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Day la tuoi nhan vien: " + tuoi_1);</div><div>&nbsp; &nbsp; }</div><div>&nbsp;&nbsp;</div><div>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 07:06:08 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785577553</guid>
      </item>
      <item>
         <title>Câu 2. Phân biệt biến và hằng trong Java.Cho ví dụ minh họa.Cần lưu ý gì khi đặt tên?</title>
         <author>baodeptrainhatxom</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785580813</link>
         <description><![CDATA[]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 07:11:52 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785580813</guid>
      </item>
      <item>
         <title>Đặt Tên Cho Biến</title>
         <author>3120218008</author>
         <link>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785594218</link>
         <description><![CDATA[<div><br></div><div><strong>Quy Tắc 1<br></strong><br></div><div><strong><em>Ký tự bắt đầu của tên biến phải là chữ cái, hoặc dấu gạch dưới (_), hoặc ký tự đô la ($)</em></strong>.<br><br></div><div><strong>Quy Tắc 2<br></strong><br></div><div><strong><em>Không được có khoảng trắng giữa các ký tự của biến</em></strong>.<br><br></div><div><strong><br>Quy Tắc 3<br></strong><br></div><div><strong><em>Không chứa ký tựđặc biệt bên trong tên biến như</em></strong><em> </em><strong><em>!@#%^&amp;*</em></strong>.&nbsp;<br><br></div><div><strong><br>Quy Tắc 4<br></strong><br></div><div><strong><em>Không được đặt tên biến trùng với keyword</em></strong>.<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 07:32:50 UTC</pubDate>
         <guid>https://padlet.com/giaquyentran365/yvvxd8xmy0cjj3e7/wish/1785594218</guid>
      </item>
   </channel>
</rss>
