<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>CMPD363 - Object-Oriented Programming by Nur Hanani</title>
      <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344</link>
      <description>Chapter 5 - Exceptions and Assertions in Java</description>
      <language>en-us</language>
      <pubDate>2018-10-15 02:46:47 UTC</pubDate>
      <lastBuildDate>2025-12-15 07:37:41 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/8.0/png/1f469-1f3eb.png</url>
      </image>
      <item>
         <title>Write your summary of Chapter 5 - Exceptions and Assertions here!
</title>
         <author>trulyhanani</author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701136796</link>
         <description><![CDATA[<p>Dear Section 1A, kindly post your summary of Chapter 5 - Exceptions and Assertions here! Don't forget to write your full name and student ID as well ya. Good luck all!</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-27 13:38:47 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701136796</guid>
      </item>
      <item>
         <title>Mohamad Nabil Bin Mohamad Azmir DC98977</title>
         <author>mnabilazmir</author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701808386</link>
         <description><![CDATA[<p>Chapter 5 is about learning this exception ( a type of invalid or abnormal occurance during a normal course of a program) in java. We learning 3 catergories of exception which is checked exception, uncheck exception and errors. Beside that, we learn different methods to catch exception such as try/catch,throw, the finally block and assertions</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 02:51:31 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701808386</guid>
      </item>
      <item>
         <title>Nur Qistina Binti Noor Shaifull (DC98943)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701860719</link>
         <description><![CDATA[<p><br>Chapter 5 Exception and Assertion</p><ul><li><p>3 questions will be in finals MCQ</p></li></ul><p><br/></p><p>Introduction</p><ul><li><p>In Java, instead of getting error message, you can throw an Exception object to the caller and caller will handle the exception.</p></li><li><p>Exception occurs when normal flow of program gets disrupted and programs get terminated abnormally, which is not recommended.</p></li><li><p>Can be caused by user error, programmer error, or physical resource that failed.</p></li></ul><p><br/></p><p>three categories of exceptions:-</p><p>Checked exceptions:</p><ul><li><p>Occurs during compile time (compile time exceptions)</p></li><li><p>Cannot be ignored at compilation time, must be handled by programmer.</p></li><li><p>Example: FileNotFoundException</p></li></ul><p><br/></p><p>Unchecked exceptions</p><ul><li><p>Occurs during time of execution (Runtime exceptions)</p></li><li><p>programming bugs such as logic errors or improper use of API</p></li><li><p>ignored during compilation</p></li><li><p>Example: ArrayIndexOutOfBpund Exception</p></li></ul><p>Errors</p><ul><li><p>Not exception, but problem beyond control</p></li><li><p>Usually ignored since it can't be handled</p></li><li><p>Example: StackOverFlowError</p></li></ul><p><br/></p><p>Exception</p><ul><li><p>An error that occur during normal course of program execution.</p></li><li><p>When occurs (thrown), normal sequence of flow is terminated, exception-handling routine executed (caught)</p></li></ul><p>Try and catch</p><ul><li><p>Catches exception inside code using try block, and will be handled by catch block.</p></li><li><p>Catch: give message to user when exception occurs</p></li></ul><p>Throw</p><ul><li><p>Used to throw an exception explicitly.</p></li></ul><p><br/></p><p>Finally</p><ul><li><p>Used when certain actions need to be taken regardless of whether exception is thrown or not.</p></li><li><p>Can be used for cleanup code after the try-catch statement.</p></li></ul><p><br/></p><p>Assertion</p><ul><li><p>Used to detect logical errors</p></li><li><p>Expression must be true otherwise AssertionError is thrown.</p></li><li><p>3 type of assertion:</p></li></ul><ol><li><p>Post-condition assertion</p></li><li><p>Pre-condition assertion</p></li><li><p>Control flow invariant</p></li></ol>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 03:24:04 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701860719</guid>
      </item>
      <item>
         <title>Nur Alia Adziani binti Abdul Aziz (Dc99016)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701901827</link>
         <description><![CDATA[<p>Chapter 5 – Exceptions &amp; Assertions</p><p><br/></p><p>Exceptions are errors that happen while a program is running.</p><p>When an exception happens, the normal flow of the program stops.</p><p><br/></p><p>Example causes:</p><p><br/></p><ul><li><p>User enters wrong input</p></li><li><p>File cannot be found</p></li><li><p>Internet connection lost</p></li><li><p>Program runs out of memory</p></li></ul><p><br/></p><p>There Are 3 categories</p><p>-Checked Exception</p><ul><li><p>Happen at compile time.</p></li><li><p>Java forces you to handle them</p></li></ul><p><br/></p><p>Unhecked Exceptions</p><ul><li><p>Happen at runtime</p></li><li><p>caused by programming mistakes</p></li></ul><p><br/></p><p>Errors</p><ul><li><p>very serious issues</p></li><li><p>cannot be handle by the program</p></li></ul><p><br/></p><p>Handle Exceptions</p><p>Try</p><p>-code that might cause an error</p><p>Catch</p><p>-Handle that error if it happens</p><p><br/></p><p>Finally</p><p>-always run, wheter there is an error or not</p><p>-Good for cleanup</p><p><br/></p><p>Assertions</p><p>-Assertion are used to detect logic errors during development</p><p>Types:</p><p><br/></p><ul><li><p>Pre-condition (before method runs)</p></li><li><p>Post-condition (after operation)</p></li><li><p>Control-flow invariant (should always be true)</p></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 04:00:54 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701901827</guid>
      </item>
      <item>
         <title>Nur Aina Aliah Binti Sukar @ Yahya (DC98942)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701909585</link>
         <description><![CDATA[<p>Exceptions and Assertions Summary</p><p><br/></p><p>This chapter explains how to manages errors using exceptions and assertions. Exceptions interrupt normal program flow, so Java provides try-catch blocks and the finally block to handle them. Exceptions are divided into checked (compile time), unchecked (runtime), and errors (serious system failure). The throw keyword can be used to manually create exceptions. Assertions are used to verify logical conditions during development. If an assertion fail, the program throws an AssertionError. There are 3 types of assertion including Post-condition assertion, Pre-condition assertion, and Control flow invariant.</p><p><br/></p><p>note: will come out in final Section A (MCQ, only 3 question)</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 04:10:19 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701909585</guid>
      </item>
      <item>
         <title>Eiman Rais Bin Abdul Rais DC98966</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701955091</link>
         <description><![CDATA[<p>Exceptions are problems that happen while a program is running, and Java handles them using try, catch, and blocks. Types of exception checked exception, unchecked exception, and error. You can also throw your own exception using throw. Java also has assertion, which check if something in your program should logically be true; if it’s false, the program stops with an error. This helps you find mistakes during development.</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 04:49:21 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3701955091</guid>
      </item>
      <item>
         <title>Chin Lam Fung DC98979</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702060954</link>
         <description><![CDATA[<p><strong>Exceptions</strong></p><p>Exceptions are errors that happen while a program is running.<br>When an exception occurs, the normal flow of the program stops.</p><p><strong>Example causes</strong></p><ul><li><p>User enters wrong input</p></li><li><p>File cannot be found</p></li><li><p>Internet connection lost</p></li><li><p>Program runs out of memory</p></li></ul><p><strong>3 Categories of Exceptions</strong></p><p><strong>Checked Exception</strong></p><ul><li><p>Happen at compile time</p></li><li><p>Java forces you to handle them</p></li></ul><p><strong>Unchecked Exception</strong></p><ul><li><p>Happen at runtime</p></li><li><p>Caused by programming mistakes</p></li></ul><p><strong>Errors</strong></p><ul><li><p>Very serious issues</p></li><li><p>Cannot be handled by the program</p></li></ul><p><strong>Handling Exceptions</strong></p><p><strong>try</strong></p><ul><li><p>Code that might cause an error</p></li></ul><p><strong>catch</strong></p><ul><li><p>Handles the error if it happens</p></li></ul><p><strong>finally</strong></p><ul><li><p>Always runs, whether an error occurs or not</p></li><li><p>Good for cleanup</p></li></ul><p><strong>Assertions</strong></p><p>Assertions are used to detect logic errors during development.</p><p><strong>Types</strong></p><ul><li><p>Pre-condition (before method runs)</p></li><li><p>Post-condition (after operation)</p></li><li><p>Control-flow invariant (should always be true)</p></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 06:26:46 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702060954</guid>
      </item>
      <item>
         <title>Ikmal Syafie DC99019</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702115484</link>
         <description><![CDATA[<p>Exceptions are unexpected events that occur while a program is running. When an exception happens, the normal flow of the program is interrupted.</p><p><br/></p><p>Common causes include:</p><p><br/></p><ul><li><p>The user enters invalid input</p></li><li><p>A file that the program needs cannot be found</p></li><li><p>The internet connection is lost</p></li><li><p>The program runs out of memory</p></li></ul><p><br/></p><p><br/></p><p>Java classifies exceptions into three main groups:</p><p><br/></p><p><strong>1. Checked Exceptions</strong></p><p><br/></p><ul><li><p>Detected during the compilation stage</p></li><li><p>Java requires the programmer to handle them using a try–catch block or by declaring them with throws</p></li><li><p>Example: FileNotFoundException</p><p><br/></p></li></ul><p><br/></p><p><strong>2. Unchecked Exceptions (Runtime Exceptions)</strong></p><p><br/></p><ul><li><p>Occur while the program is being executed</p></li><li><p>Usually caused by programming mistakes such as logic errors or incorrect use of an API</p></li><li><p>The compiler does not force programmers to handle them</p></li><li><p>Example: ArrayIndexOutOfBoundsException</p></li></ul><p><br/></p><p><strong>3. Errors</strong></p><p><br/></p><ul><li><p>More serious issues that are generally outside the program’s control</p></li><li><p>These problems cannot usually be handled by the application</p></li></ul><p><br/></p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 07:21:44 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702115484</guid>
      </item>
      <item>
         <title>Levin Matthew A/L Chandrasegaran (DC98967)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702649912</link>
         <description><![CDATA[<p>Chapter 5: Exceptions and Assertion</p><p><br/></p><p>Definition of Exception -&gt; Represents an error condition that occurs during a program execution</p><p><br/></p><p>Instead of an error message, the compiler throwss a exception object like IllegalArgumentException to the caller and let it handle it.</p><p><br/></p><p>Exception occurs when the program contains invalid data, a file can't be found and in network connection issues. The exception can be caused by the programmer errror. </p><p><br/></p><p>Three categories of exception;</p><ul><li><p>Checked exception -&gt; occurs during compile time</p></li><li><p>unchecked exception -&gt; occurs during execution time</p></li><li><p>errors -&gt; handled by programmer and its usually not an exception</p></li></ul><p><br/></p><p>Try and Catch blocks</p><ul><li><p>Its a method to catch an exception of these two blocks. Every try block comes with a finally block.</p></li></ul><p>Catch: Gives the message to the user when error occurs.</p><p><br/></p><p>Throw keyword is used to throw an exception explicitly.</p><p><br/></p><p>Finally Block: If no error-&gt; DONE</p><p>If got error -&gt; "Not an integer"</p><p><br/></p><p>Assertion -&gt; Used to detect logical errors in program(true or false)</p><p><br/></p><p>The syntax used is "assert" &lt;boolean expression&gt;</p><p><br/></p><p>3 Types of assertion: Pre-condition, post condition and control flow invariant.</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-28 17:57:09 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3702649912</guid>
      </item>
      <item>
         <title>Muhammad Abid Danial (DC99048)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3703801285</link>
         <description><![CDATA[<p>This chapter explain about exception and assertion. Exception is is an error that happens while the program is running, such as dividing by zero, accessing an invalid array index, or opening a file that does not exist. When an exception occurs, it interrupts the normal flow of the program unless it is handled using a try–catch or throw-else block. Exceptions are used to deal with problems that can realistically happen during program execution. On the other hand, an <em>assertion</em> is a tool used by developers to check logical error that are supposed to be true during the development or debugging stage. There are 3 types of assertion which is Post-condition assertion, Pre-condition assertion and control flow invariant.</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-30 17:19:10 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3703801285</guid>
      </item>
      <item>
         <title>Nasruddin Aiman Bin Putera (DC98944)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3703900260</link>
         <description><![CDATA[<p>Chapter 5 covers how Java handles abnormal or invalid events using exceptions and assertions. Exceptions are grouped into 3 categories: checked, unchecked, and errors. Java manages exceptions using try-catch blocks, manually throwing exceptions with throw, executing cleanup code with finally, and validating logic during development using assertions. When an assertion fails, an AssertionError is thrown.</p>]]></description>
         <enclosure url="" />
         <pubDate>2025-11-30 20:09:56 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3703900260</guid>
      </item>
      <item>
         <title>Muhammad Akmal Hariz bin Mohd Fadzli(dc98999)</title>
         <author></author>
         <link>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3722678459</link>
         <description><![CDATA[<p>Chapter 5: Exception and Assertion</p><p>In the final exam, <strong>3 MCQ questions</strong> will be asked from this chapter.</p><p>Introduction</p><p>In Java, instead of showing an error message directly, a program can <strong>throw an Exception object</strong>. This exception is sent to another part of the program, where it is <strong>handled properly</strong>.</p><p>An <strong>exception</strong> happens when the normal execution of a program is interrupted. If exceptions are not handled, the program may stop running suddenly, which is <strong>not a good practice</strong>.</p><p>Exceptions can occur due to:</p><ul><li><p>Mistakes made by the user</p></li><li><p>Errors made by the programmer</p></li><li><p>Failure of system resources (like memory or files)</p></li></ul><p>Types of Exceptions</p><p>There are <strong>three main categories</strong>:</p><p>1. Checked Exceptions</p><ul><li><p>Occur <strong>during compilation</strong></p></li><li><p>The compiler forces the programmer to <strong>handle them</strong></p></li><li><p>Cannot be ignored</p></li><li><p>Example: FileNotFoundException</p></li></ul><p>2. Unchecked Exceptions</p><ul><li><p>Occur <strong>at runtime (during execution)</strong></p></li><li><p>Usually caused by programming mistakes such as wrong logic or incorrect API usage</p></li><li><p>Not checked at compile time</p></li><li><p>Example: ArrayIndexOutOfBoundsException</p></li></ul><p>3. Errors</p><ul><li><p>These are <strong>not exceptions</strong></p></li><li><p>Caused by serious problems that are <strong>outside the control of the program</strong></p></li><li><p>Generally cannot be handled</p></li><li><p>Example: StackOverflowError</p></li></ul><p>Exception</p><p>An exception is a problem that occurs while the program is running normally.<br>When an exception is <strong>thrown</strong>, the normal flow of the program stops, and the program looks for an <strong>exception-handling block</strong> to manage it.</p><p>Try and Catch</p><ul><li><p>The try block contains code that may cause an exception</p></li><li><p>The catch block handles the exception</p></li><li><p>The catch block usually shows an <strong>error message</strong> or performs corrective actions</p></li></ul><p>Throw</p><ul><li><p>The throw keyword is used to <strong>manually generate an exception</strong></p></li><li><p>It allows the programmer to pass the exception to another part of the program</p></li></ul><p>Finally</p><ul><li><p>The finally block executes <strong>whether an exception occurs or not</strong></p></li><li><p>Commonly used for <strong>cleanup tasks</strong>, such as closing files or releasing resources</p></li></ul><p>Assertion</p><p>Assertions are used to <strong>find logical mistakes</strong> in a program.<br>An assertion checks whether a condition is <strong>true</strong>. If the condition is false, an AssertionError is thrown.</p><p>Types of Assertions</p><ol><li><p><strong>Pre-condition assertion</strong> – checks conditions before executing a statement</p></li><li><p><strong>Post-condition assertion</strong> – checks conditions after execution</p></li><li><p><strong>Control flow invariant</strong> – ensures conditions remain true during program execution</p></li></ol>]]></description>
         <enclosure url="" />
         <pubDate>2025-12-15 07:37:40 UTC</pubDate>
         <guid>https://padlet.com/trulyhanani/mdm_hanani_CMPD344/wish/3722678459</guid>
      </item>
   </channel>
</rss>
