Grade 11 Examples

First Java Application

01. Java Installation

02. click to see the emample

Print and format

03. System.out.print        show code...


04. Escape sequences        show code...


                                       05. format() handout


06. System.out.format       show code...


07. Advanced: System.out.format       show code...

Variables and Calculations

08. Simple variable       show code...


09. Display digits of 2-digit number       show code...


10. Using Math class       show code...


11. Random Numbers       show code...


Input: Scanner JOptionPane

12. Scanner (integer & String)       show code...


13. Scanner (several integers)       show code...


14. Scanner (Double and Int)       show code...


15. Scanner (go from numbers to Strings)       show code...


16. JOptionPane       show code...


If and Switch

17. If simple Demo       show code...


18. Switch demo       show code...


19. Boolean Expressions 1       show code...


20. Boolean Expressions 2       show code...


21. Nested Structures       show code...


Loops

22. While Loop Demo       show code...


23. For Loop Demo       show code...


24. Simple Loops       show code...


25. Nested For Loops       show code...


Strings

26. Simple string example       show code...


27. Reading files (vegetables or fruits)       show code...


28. Pick a random word from file       show code...


29. String game. Pick a word in method       show code...



Arrays

31. Array declare/populate/print simple Demo show code...


32. click to see more Array examples (reverse, max, min, median, average, sort, populate)



Methods


33. Method example 00       show code...


34. Method example 01       show code...


35. Method example 02       show code...


36. More Method Examples click to see the emample


Object Oriented Programming

37. Intro to Objects       Intro to OO

38. Candy Eaters example       show code...


39. UML and Encapsulation       a_19_UML and Encapsulation lesson.doc

40. Overloading toString()      a_21_Overloading lesson.doc

41. Inheritance       a_22_Inheritance.doc

42. Static non-static variables and methods 23_Static_Methods_Variables.doc

43. OOP definitions. More OO examples. Polymorphism OOP_06_definitions_Polymorphism.doc

44. Fraction demo       show code...


45. Array List Class       DynamicArrays_ArrayLists.doc

46. Array Lists demo       show code...