Содержание
- 2. Agenda Operators Conditional statements Enum Comparing objects JUnit Practical tasks
- 3. Simple Assignment Operator = Simple assignment operator Arithmetic operators Arithmetic Operators + Additive operator (also used
- 4. Unary Operators Unary Operators + Unary plus; indicates positive value - Unary minus; negates an expression
- 5. Equality and Relational Operators == Equal to != Not equal to > Greater than >= Greater
- 6. The && and || operators perform Conditional-AND and Conditional-OR operations on two boolean expressions. && Conditional-AND
- 7. Ternary Operator ? : condition ? value1 : value2 What are the values of variable str1
- 8. Statement if if (condition) { then-statement; } if (condition) { then-statement; } else { else-statement; }
- 9. switch (expression) { case const-expr1 : statement(s); break; case const-expr1 : statement(s); break; default : statement(s);
- 10. Example BufferedReader br = new BufferedReader( new InputStreamReader(System.in)); System.out.println("Do you enjoy Java? (yes/no/maybe)"); String input =
- 11. An enum type is a special data type that enables for a variable to be a
- 12. Season season; ... switch (month) { case "Desember": case "January": case "February": season = Season.WINTER; break;
- 13. public class Student { private String name; private int age; public Student(String name, int age) {
- 14. hashCode @Override public int hashCode() { final int prime = 31; int result = 1; result
- 15. equals @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj ==
- 16. JUnit Framework JUnit is a unit testing framework for the Java programming language. JUnit has been
- 17. Testing Problems Programmers should write tests As you probably know programmers always busy, and they have
- 18. JUnit plugin for Eclipse IDE Mr. Erich Gamma who is a one of developers of JUnit
- 19. JUnit assertion methods
- 20. JUnit
- 21. JUnit
- 22. public class Calc { public int add(int a, int b) { return a + b; }
- 23. import static org.junit.Assert.*; import org.junit.Test; public class CalcTest { Calc calc = new Calc(); @Test public
- 24. Enter three numbers. Find out how many of them are odd. Enter the number of the
- 25. HomeWork (online course) UDEMY course "Java Tutorial for Complete Beginners": https://www.udemy.com/java-tutorial/ Complete lessons 10, 11, 13:
- 26. Unit Testing with JUnit Short step-by-step online course: https://www.udemy.com/junit-tutorial-for-beginners-with-java-examples/learn/v4/overview
- 27. Solve the next tasks: read 3 float numbers and check: are they all belong to the
- 29. Скачать презентацию