Programming with Java Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
Day 2 1. What is a compiler? 2. What is Java byte code? 3. Give an example of a lexical error in Java 4. Give an example of a syntactic error in Java 5. Give an example of a semantic error in Java
Day 3 1. What is a variable? 2. What is a method? 3. What is a class? 4. Create a program that prints “This is my exam”. Including the code for creating a class and main method. 5. Write 3 reserved words in Java
Day 4 1. Write a multi-line comment with your name and ASUID 2. Mention the 8 primitive types defined in Java 3. Is the following statement, correct? char = ' ' '; 4. Is the following statement, correct? boolean result = 5 + 2 > 5 - 1 ; 5. What is the result of (-20 % 3 -2)
Day 5, 6 1. What is the result of 1 % 2 - 3 / 4 * 5 / 6 + 7 2. Is the following, correct? If so, What is the result? 1 % 2 - 3 / 4 * 5 / 6 + 7 + “Hello” 3. Is the following, correct? If so, What is the result? ”Hello” + 1 % 2 - 3 / 4 * 5 / 6 + 7 4. Is the following, correct? If so, What is the result? float f = 2.5f + 2.5f; System.out.println(f); 5. Is the following, correct? If so, What is the result? System.out.println( Math.pow(5.0,2.0) );
Day 7 1. What is a package? 2. What is the next instruction for? JOptionPane.showInputDialog(“this is a message”); 3. What is the next instruction for? Integer.parseInt(“12345”); 4. What is JOptionPane? 5. What is showInputDialog?
Ph.D. [email protected] Fall 2021 Copyright. These slides can only be used as study material for the class CSE205 at Arizona State University. They cannot be distributed or used for another purpose.