<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>OOD Class stuff by AhmadTaiff Isahak</title>
      <link>https://padlet.com/taiffdisted/r5ncqqn167x2</link>
      <description>Made with charisma</description>
      <language>en-us</language>
      <pubDate>2017-08-25 03:05:02 UTC</pubDate>
      <lastBuildDate>2017-10-16 09:26:50 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Demo Abstract</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/182731251</link>
         <description><![CDATA[<div>/* package whatever; // don't place package name! */<br><br>import java.util.*;<br>import java.lang.*;<br>import java.io.*;<br><br>/* Name of the class has to be "Main" only if the class is public. */<br>class Ideone<br>{<br>	public static void main (String[] args) throws java.lang.Exception<br>	{<br>		Student s=new Student();<br>		s.sayHi();<br>//		Person p=new Person();<br>//		p.sayHi();<br>		Person p;<br>		p=s;<br>		p.sayHi();<br>		<br>	}<br>}<br><br>abstract class Person {<br>	abstract void sayHi();<br>/*	{<br>		System.out.println("Ahoi from a Person");<br>	}<br>	*/<br>}<br><br>class Student extends Person {<br>	void sayHi() {<br>		System.out.println("Olla from a Student");<br>	}<br><br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2017-08-25 03:06:46 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/182731251</guid>
      </item>
      <item>
         <title>Demo Exception</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/185015462</link>
         <description><![CDATA[<div>import java.lang.Math; // headers MUST be above the first class<br>import java.lang.Exception.*;<br><br>// one class needs to have a main() method<br>public class HelloWorld<br>{<br>  // arguments are passed using the text field below this editor<br>  public static void main(String[] args) {<br>    OtherClass myObject = new OtherClass("Hello World!");<br>    System.out.println(myObject);<br>    try {<br>      	String s1=myObject.getString("WooHOO");<br>	    int i=myObject.getNumber();<br>      	String s2=myObject.getString("WhatLaoEh");<br>    }<br>    catch(ArithmeticException e1) {<br>      System.out.println("Yo dude! Go back to Arihtmetic class!");<br>    }<br>    finally {<br>     	System.out.println("Finally I'm DONE!"); <br>    }<br>  }<br>}<br><br>// you can add other public classes to this editor in any order<br>public class OtherClass {<br>  private String message;<br>  private boolean answer = false;<br>  public OtherClass(String input) {<br>    message = "Why, " + input + " Isn't this something?";<br>  }<br>  public String toString() {<br>    return message;<br>  }<br>  public int getNumber() {// throws Exception {<br>    int i=3/0;<br>    System.out.println("in GET NUMBER");<br>    return i;<br>  }<br>  public String getString(String stuff) {<br>    System.out.println(stuff);<br>    return stuff;<br>  }<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-09-06 06:45:54 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/185015462</guid>
      </item>
      <item>
         <title>Demo Exception with Nested Calls</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/185017725</link>
         <description><![CDATA[<div>import java.lang.Math; // headers MUST be above the first class<br>import java.lang.Exception.*;<br><br>// one class needs to have a main() method<br>public class HelloWorld<br>{<br>  // arguments are passed using the text field below this editor<br>  public static void main(String[] args) {<br>    OtherClass myObject = new OtherClass("Hello World!");<br>    System.out.println(myObject);<br>    try {<br>      	String s1=myObject.getString("WooHOO");<br>	    int i=myObject.getJunk1(); //myObject.getNumber();<br>      	String s2=myObject.getString("WhatLaoEh");<br>    }<br>    catch(ArithmeticException e1) {<br>      System.out.println("Yo dude! Go back to Arihtmetic class!");<br>    }<br>    finally {<br>     	System.out.println("Finally I'm DONE!"); <br>    }<br>  }<br>}<br><br>// you can add other public classes to this editor in any order<br>public class OtherClass {<br>  private String message;<br>  private boolean answer = false;<br>  public OtherClass(String input) {<br>    message = "Why, " + input + " Isn't this something?";<br>  }<br>  public String toString() {<br>    return message;<br>  }<br>  public int getNumber() {// throws Exception {<br>    int i=3/0;<br>    System.out.println("in GET NUMBER");<br>    return i;<br>  }<br>  public String getString(String stuff) {<br>    System.out.println(stuff);<br>    return stuff;<br>  }<br>  public int getJunk1() {<br>    int a=0;<br>    try {<br>      a=this.getJunk2();<br>      System.out.println("Normal Junk1");<br>    }<br>    catch(ArithmeticException e2) {<br>      System.out.println("Caught ArithmeticException in getJunk1");<br>    }<br>    finally {<br>     	System.out.println("in JUNK1"); <br>    }<br>    return a;<br>  }<br>  <br>  public int getJunk2() {<br>    int b=0;<br>    try {<br>      b=this.getJunk3(); <br>      System.out.println("Normal Junk2");<br>    }<br>    finally {<br>     	System.out.println("in JUNK2"); <br>    }<br>    return b;<br>  }<br>  <br>  public int getJunk3() {<br>    int x=10/0;<br>    System.out.println("Normal Junk3");    <br>    return x;<br>  }<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-09-06 06:59:11 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/185017725</guid>
      </item>
      <item>
         <title>What happens when you click  the &#39;PressMe&#39; button:</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192316819</link>
         <description><![CDATA[<div>1. Since the Controller is a Listener to the button, the actionPerformed method is called;<br>2. The actionPerformed method calls the incrementValue() method in the Model;<br>3. The Model updates the counter value by 1, calls setChanged(), and finally notifyObservers() and passing the new counter value as parameter;<br>4. Since the View is an Observer (linked to the Model in the RunMVC constructor), it's update() method is called (via notifyObservers());<br>5. The update() method gets the counter value and sets the textField to the value.</div>]]></description>
         <enclosure url="" />
         <pubDate>2017-09-29 02:28:37 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192316819</guid>
      </item>
      <item>
         <title>Model.java</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839530</link>
         <description><![CDATA[<div>	public void decrementValue() {<br>		--counter;<br>		System.out.println("Model&nbsp; &nbsp; &nbsp;: counter = " + counter);<br>		setChanged();<br>		notifyObservers(counter);<br>	}</div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-02 02:48:02 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839530</guid>
      </item>
      <item>
         <title>Controller.java</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839571</link>
         <description><![CDATA[<div>	public void actionBtnDecrease() {<br>		System.out.println("Controller: acting on Model");<br>		model.decrementValue();		<br>	}<br><br>	public void actionBtnReset() {<br>		System.out.println("Controller: acting on Model");<br>		model.setValue(0);		<br>	}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-02 02:48:36 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839571</guid>
      </item>
      <item>
         <title>View.java</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839601</link>
         <description><![CDATA[<div>...<br>	private Button btnIncrease;&nbsp;<br>	private Button btnDecrease;<br>	private Button btnReset;<br>	private Controller myController;<br>...<br><br>in Constructor:<br>		btnIncrease		= new Button("Increase");<br>		btnDecrease		= new Button("Decrease");<br>		btnReset		= new Button("Reset");<br>		panel.add(btnDecrease);<br>		panel.add(btnReset);<br>		panel.add(btnIncrease);<br>...<br>	public void addController(ActionListener controller){<br>		System.out.println("View&nbsp; &nbsp; &nbsp; : adding controller");<br>		btnIncrease.addActionListener(controller);	//need instance of controller before can add it as a listener<br>		this.myController=(Controller)controller;<br>		btnDecrease.addActionListener(&nbsp;<br>			&nbsp; &nbsp; new java.awt.event.ActionListener() {<br>				&nbsp; &nbsp; &nbsp; public void actionPerformed (java.awt.event.ActionEvent e)&nbsp; {<br>				&nbsp; &nbsp; 	&nbsp; myController.actionBtnDecrease();<br>				&nbsp; &nbsp; &nbsp; }<br>				&nbsp; &nbsp; }<br>				&nbsp; );<br>		btnReset.addActionListener(&nbsp;<br>			&nbsp; &nbsp; new java.awt.event.ActionListener() {<br>				&nbsp; &nbsp; &nbsp; public void actionPerformed (java.awt.event.ActionEvent e)&nbsp; {<br>				&nbsp; &nbsp; 	&nbsp; myController.actionBtnReset();<br>				&nbsp; &nbsp; &nbsp; }<br>				&nbsp; &nbsp; }<br>				&nbsp; );<br><br>	} //addController()<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-02 02:48:59 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/192839601</guid>
      </item>
      <item>
         <title>Sample</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/194547868</link>
         <description><![CDATA[<div>SELECT * FROM AYAM WHERE WEIGHT&lt;5<br><br><br>SELECT * FROM AYAM WHERE WEIGHT&lt;5 OR TRUE<br><br><br>String sql="SELECT * FROM AYAM WHERE WEIGHT";<br><br>condition="&lt;5 OR TRUE";<br><br>String sqlToExec = sql+condition;</div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-06 03:14:37 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/194547868</guid>
      </item>
      <item>
         <title>Sample</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/194548007</link>
         <description><![CDATA[<div>Table: Balance<br>acctNo&nbsp; &nbsp; &nbsp;balance <br>111&nbsp; &nbsp; &nbsp;1000<br>222&nbsp; &nbsp; &nbsp;1000<br><br>What SQL statement to execute to transfer 500 from account 111 to 222?<br><br>1. SQL1: UPDATE Balance SET balance=500 WHERE accountNum=111<br>2. SQL2: UPDATE Balance SET balance=1500 WHERE accountNum=222<br><br>What happens if system fails after executing SQL1 but before executing SQL2?<br><br>acctNo&nbsp; &nbsp; &nbsp;balance <br>111&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 500<br>222&nbsp; &nbsp; &nbsp; &nbsp; 1000<br><br>I.e. acctNo has lost 500 to the 'system'!!!<br><br><strong>To Avoid, use Transactions</strong><br> transaction Start<br> SQL1<br> SQL2<br> ...<br> transaction commit<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-06 03:16:07 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/194548007</guid>
      </item>
      <item>
         <title>Simple Pause console function</title>
         <author>taiffdisted</author>
         <link>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/197259760</link>
         <description><![CDATA[<div>void pause()  {<br>  try {<br>   out.printf("\n\n  Press ENTER..");<br>   System.in.read();<br>  }<br>  catch(IOException exe){<br>   out.printf("Error?");<br>  }<br> }</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2017-10-16 09:23:22 UTC</pubDate>
         <guid>https://padlet.com/taiffdisted/r5ncqqn167x2/wish/197259760</guid>
      </item>
   </channel>
</rss>
