<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Nhóm 10 - Xóm Nhà Lá - Java Chiều 2/10 by Lê Trần Thị Bích Tuyên</title>
      <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l</link>
      <description>Đề tài: Quản Lý Sinh Viên.</description>
      <language>en-us</language>
      <pubDate>2021-10-02 05:40:53 UTC</pubDate>
      <lastBuildDate>2025-04-12 13:34:22 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f642.png</url>
      </image>
      <item>
         <title>Câu 1 : Trong Java có những kiểu dữ liệu nào ? Cho ví dụ cụ thể.</title>
         <author>lhuyy219</author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785580738</link>
         <description><![CDATA[<div>Trong Java có 2 kiểu dữ liệu chính:</div><ul><li>&nbsp;(Primitive Data Types).</li><li>(Reference Types).</li></ul><var>1. Kiểu dữ (Primitive Data Types)</var><div>&nbsp;<br>- Kiểu boolean trong Java</div><pre>public class tuandc {
 static boolean gioitinh;
 public static void main(String[] args) {
   if (gioitinh == true)
   {
      System.out.println("Nam");
   }
   else{
      System.out.println("Nữ");
   }
 }
}</pre><div>- Kiểu char trong Java:</div><pre>public class tuandc {
  static char kytu = '%';
  public static void main(String[] args) {
    System.out.println(kytu);
  }
}</pre><div>- Kiểu byte trong Java:</div><pre>public class tuandc {
 static byte kytu = 127;
 public static void main(String[] args) {
   System.out.println(kytu + 1);
 }
}</pre><div>- Kiểu short trong Java:</div><pre>public class tuandc {
 static short so = -2^15;
 public static void main(String[] args) {
   System.out.println(so + 1);
 }
}</pre><div>- Kiểu int trong Java:</div><pre>public class tuandc {
 static int so = 14;
 public static void main(String[] args) {
   System.out.println(so + 1);
 }
}</pre><div>- Kiểu long trong Java:</div><pre>public class tuandc {
 
 static long so = 2147483647; //Giá trị trong khoảng INT
 static long soL = 2147483648L; //Giá trị ngoài khoảng INT
 
 public static void main(String[] args) {
   System.out.println(so);
   System.out.println(soL);
 }
}</pre><div>- Kiểu float trong Java:</div><pre>public class tuandc {
 
 static float so = 2147483647;
 static float soF = 2147483648.9f;
 
 public static void main(String[] args) {
   System.out.println(so);
   System.out.println(soF);
 }
}</pre><div>- Kiểu double trong Java:</div><pre>public class tuandc {
 
 static float so = 2147483647;
 static double soD = 2147483648.9d;
 
 public static void main(String[] args) {
   System.out.println(so);
   System.out.println(soD);
 }</pre><div>&nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2. Kiểu dữ liệu (Reference Types)</div><ul><li>Các kiểu dữ liệu tham chiếu được tạo ra dựa trên một lớp. Lớp (class) giống như một bản thiết kế (blueprint) để định nghĩa một kiểu tham chiếu.</li></ul><div>VD: <br><strong>class</strong> <strong>Address</strong>&nbsp; {<br>&nbsp; &nbsp; String address;<br>&nbsp; &nbsp; String cityName;<br>}<br><br><strong>class</strong> <strong>Student</strong> {<br><br>&nbsp; &nbsp;String fullName;<br><br>&nbsp; &nbsp;int age;<br><br>&nbsp; &nbsp;Address address; &nbsp;<br>&nbsp; &nbsp;<br>}</div><div><br><br><br></div><div><strong><br><br></strong><br></div><div><br><br></div><div><br><br></div><div><br><br><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758063/e20a8721b0c14cdf5af46814a5ca2467/cac_kieu_du_lieu_trong_java_1024x536.jpg" />
         <pubDate>2021-10-02 07:11:46 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785580738</guid>
      </item>
      <item>
         <title>Câu 4: Trong java có những loại toán tử nào? Cho ví dụ minh họa.</title>
         <author>hoanganh1112003</author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785583270</link>
         <description><![CDATA[<div>1. Toán tử số&nbsp;<br>VD: A+B, A-B, A*B, A/B, A%B, A++, B--<br>2. Toán tử quan hệ<br>VD: A==B, A!=B, A&gt;B ,A&gt;B, A&gt;=B, A&lt;=B<br>3.Toán tử thao tác bit<br>VD: a=0011 1100&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp;b= 0000 1101<br>&nbsp; &nbsp; &nbsp; &nbsp;a&amp;b=0000 1100<br>4.Toán tử logic<br>VD: A&amp;&amp;B<br>&nbsp; &nbsp; &nbsp; &nbsp;A || B<br>&nbsp; &nbsp; &nbsp; &nbsp;!(A&amp;&amp;B)<br>5.Toán tử gán&nbsp;<br>VD: C=A+B<br>&nbsp; &nbsp; &nbsp; &nbsp; C+= A (C=C+A)<br>&nbsp; &nbsp; &nbsp; &nbsp; C-= A (C=C-A)<br>&nbsp; &nbsp; &nbsp; &nbsp; C*=A&nbsp; (C=C*A)<br>&nbsp; &nbsp; &nbsp; &nbsp; C/=A (C=C/A)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;C%=A (C=C%A)...<br>6.Toán tử điều kiện<br>VD:&nbsp;</div><pre>public class Test {

   public static void main(String args[]){
      int a , b;
      a = 20;
      b = (a == 5) ? 50: 100; //Day la vi du ve toan tu dieu kien.
      System.out.println( "Gia tri cua b la : " +  b );

      b = (a == 20) ? 50: 100; //Day la vi du ve toan tu dieu kien.
      System.out.println( "Gia tri cua b la : " + b );
   }
}</pre><div>Kết quả:<br>Gia tri cua b la : 100<br>Giá tri cua b la : 50<br><br>7.Toán tử instanceof<br><br></div><pre>public class Test {

   public static void main(String args[]){
      String name = "Doan";
      // Duoi day se tra ve true neu name la mot kieu String
      boolean result = name instanceof String;  
      System.out.println( result );
   }
}</pre><div><br>Kết quả trả về :<br>true<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758776/3e5b2b64ed2e64fdac5372d20aa9bb46/1.jpg" />
         <pubDate>2021-10-02 07:14:59 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785583270</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>bichtuyen29082002</author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785585226</link>
         <description><![CDATA[<div>* Biến:<br>byte age; // khai báo tuổi sinh viên<br>string name; //khai báo tên sinh viên<br>* Hằng:<br>final byte nam_hoc_toi_da=6;<br><br>- khái niệm: là các đinh nghĩa từ bạn, nó giúp hệ thống tạo ra các vùng nhớ để lưu giữ các giá trị trong ứng dụng.<strong> </strong><strong><em>Mỗi biến đều có một kiểu dữ liệu riêng</em></strong><strong>,</strong> kiểu dữ liệu này sẽ báo cho hệ thống biết biến đó có <em>“độ lớn”</em> bao nhiêu. Độ lớn của biến sẽ cho biết khả năng lưu trữ giá trị của biến<br>- khai báo biến:</div><div>1 | kiểu_dữ_liệu&nbsp; tên_biến;</div><div>hoặc</div><div>1 | kiểu_dữ_liệu&nbsp; tên_biến = giá_trị;<br>- ví dụ khai báo biến:<br><strong>public</strong> <strong>class</strong> MyFirstClass {</div><div><br></div><div>&nbsp; &nbsp; <strong>public</strong> <strong>static</strong> <strong>void</strong> main(<strong>String</strong>[] args) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Hello World!");</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>double</strong> salary;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>int</strong> count = 0;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>boolean</strong> done = <strong>false</strong>;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; <strong>long</strong> earthPopulation;</div><div>&nbsp; &nbsp; }</div><div><br></div><div>}<br>- Hằng: <br>+ Khái niệm: <strong><em>Hằng Số</em></strong> trong tài liệu tiếng Anh gọi là <strong><em>const</em></strong>, viết tắt của từ <em>constant</em>. Hằng cũng tương tự như biến, nhưng đặc biệt ở chỗ nếu một biến được khai báo là hằng thì nó sẽ <em>không được thay đổi giá trị trong suốt chương trình</em>.<br><br></div><div><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758063/916c2eb16aa1696f45248728e3d81695/feature_green_4.png" />
         <pubDate>2021-10-02 07:18:09 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785585226</guid>
      </item>
      <item>
         <title>5 Nêu cách nhập xuất dữ liệu trong Java . Cho ví dụ </title>
         <author>hai0947642</author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785588036</link>
         <description><![CDATA[<div>có 3 cách nhập xuất dữ liệu trong Java<br><strong>cách 1 a dùng lớp Scanner<br>vd&nbsp;</strong></div><div>import java.util.Scanner;<br><br>public class nhap</div><div>{<br>&nbsp; &nbsp; public static void main(String[] args)&nbsp;</div><div>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Scanner scanIn=new Scanner(System.in);&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;String name = "";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int age;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Nhap Ten va Tuoi cua ban:");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try&nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name = scanIn.nextLine();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; age=scanIn.nextInt();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch( IOException e )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Error!");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; System.out.println("Name is" + name +"!");<br>&nbsp; &nbsp; System.out.println("Age is" + age +"!");<br>&nbsp; &nbsp; &nbsp;}<br><br>}<br><strong>cách 2 sử dụng lớp BufferReader.</strong><br><strong>vd</strong><br>import java.io.BufferedReader;<br>import java.io.IOException;<br>import java.io.InputStreamReader;<br><br>public class nhap</div><div>{<br>&nbsp; &nbsp; &nbsp; &nbsp; public static void main(String[] args)&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BufferedReader<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BufferedReader dataIn = new BufferedReader(new<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InputStreamReader( System.in) );<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String name = "";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Please Enter Your Name:");<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;name = dataIn.readLine();<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch( IOException e )</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Error!");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println("Hello " + name +"!");<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>}</div><div><br><strong>&nbsp;cách 3 sử dụng JOptionPane:<br>vd<br></strong>import javax.swing.JOptionPane;<br>public class nhap</div><div>{<br>&nbsp; &nbsp; &nbsp; public static void main(String[] args)</div><div>&nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String name = "";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; name=JOptionPane.showInputDialog("Please enter your name");<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String msg = "Hello " + name + "!";<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JOptionPane.showMessageDialog(null, msg);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Name is:"+msg);<br>&nbsp; &nbsp; &nbsp; }<br><br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758063/320892189c8fb894b6e65554d18d3b26/nhap_xuat_du_lieu_trong_java_su_dung_lop_scanner.jpg" />
         <pubDate>2021-10-02 07:22:32 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785588036</guid>
      </item>
      <item>
         <title>Câu 3: Có bao nhiêu cách ép kiểu trong java ? Cho ví dụ minh họa .</title>
         <author></author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785592432</link>
         <description><![CDATA[<div>Ép kiểu trong java là việc gán giá trị của một biến có kiểu dữ liệu này tới biến khác có kiểu dữ liệu khác.<br><br>Ví dụ:<br><br>?<br>1<br>2<br>float c = 35.8f;<br>int b = (int)c + 1;<br>Phân loại ép kiểu trong java<br>Trong Java, có hai loại ép kiểu dữ liệu:<br>1.Nới rộng (widening).<br>Ví dụ chuyển từ int sang float. Chuyển kiểu loại này có thế được thực hiện ngầm định bởi trình biên dịch.<br>Ví dụ:<br>public class TestWidening {<br>&nbsp; &nbsp; public static void main(String[] args) {<br>&nbsp; &nbsp; &nbsp; &nbsp; int i = 100;<br>&nbsp; &nbsp; &nbsp; &nbsp; long l = i;&nbsp; &nbsp; // không yêu cầu chỉ định ép kiểu<br>&nbsp; &nbsp; &nbsp; &nbsp; float f = l; &nbsp; // không yêu cầu chỉ định ép kiểu<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Int: " + i);<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Long: " + l);<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Float:&nbsp; " + f);<br>&nbsp; &nbsp; }<br>}<br>2.Thu hẹp (narrowwing).<br>Chuyển kiểu loại này không thể thực hiện ngầm định bởi trình biên dịch, người dùng phải thực hiện chuyển kiểu tường minh.<br>Ví dụ:<br>public class TestNarrowwing {<br>&nbsp; &nbsp; public static void main(String[] args) {<br>&nbsp; &nbsp; &nbsp; &nbsp; double d = 100.04;<br>&nbsp; &nbsp; &nbsp; &nbsp; long l = (long) d; // yêu cầu chỉ định kiểu dữ liệu (long)<br>&nbsp; &nbsp; &nbsp; &nbsp; int i = (int) l; // yêu cầu chỉ định kiểu dữ liệu (int)<br>&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Double: " + d);<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Long: " + l);<br>&nbsp; &nbsp; &nbsp; &nbsp; System.out.println("Giá trị Int:&nbsp; " + i);<br>&nbsp;<br>&nbsp; &nbsp; }<br>}</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1367758063/631c32f9bdcd0b2d97ac789c039228f1/ep_kieu_du_lieu_noi_rong.jpg" />
         <pubDate>2021-10-02 07:29:51 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785592432</guid>
      </item>
      <item>
         <title>Phân công nhiệm vụ. chiều 2/10 ( Đề tài: quản lý sinh viên)</title>
         <author>bichtuyen29082002</author>
         <link>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785598540</link>
         <description><![CDATA[<div>câu 1: Huy<br>câu 2: Tuyên<br>câu 3: Y<br>câu 4: Anh<br>câu 5: Hải</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-10-02 07:39:23 UTC</pubDate>
         <guid>https://padlet.com/bichtuyen29082002/tvvnoc21lpttnt2l/wish/1785598540</guid>
      </item>
   </channel>
</rss>
