Formative Review and Conditionals – Sept 3

1.Source code is the things we type to run the program including the definition of classes
5.Objects are created when the program is compiled then then you run the program the object is executed
7.A constructor is a a special procedure in the X’s definition that describes how objects of X are created
8.Constructors are public majority of the time that means that a constructor of one class can invoke contractors in another class
10.No-args means a constructor that does not take any parameters
Logical error – Syntax and other issues seen before running program
RunTimeError – Design looks all okay but problem occurs when program is run
CONDITIONALS STATEMENTS
 
public class HWorld
{
    public static void main(String[] args)
    {
        int a = 1;
        int b = 2;
        int c = 3;
        boolean m = true;
        boolean n = false;
        System.out.println(a==b); //false
        System.out.println(a!=b); //true
        System.out.println(!n); //true
        System.out.println(m && n); //false
        System.out.println(m || n); //true
        System.out.println(!(m && n)); //true
        System.out.println(!m && n); //false
        System.out.println(m && !n); //true
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *