click below
click below
Normal Size Small Size show me how
in programing
| Question | Answer |
|---|---|
| Test Plans should test | ever condition possible. valid or invalid. |
| Every object created with new has | Its own copy of the attributes stored in memory |
| char size | 2 bytes or 16 bits |
| int size | 4 bytes or 32 bits |
| how to compile JavaMain.java | javac JavaMain.java |
| A java file need to have what to compile | public static void main(String[] argv) { } |
| A programmer requires knowledge of the language also called | syntax |
| double size | 8 bytes or 64bits |
| float size | 4 bytes or 32 bits(same as int) |
| long size | 8 bytes or 64bits(same as double) |
| to define a number as a float you need to | (float)9.9 or 9.9f |
| strings and char require | single or double qoutes 'A' "A" |
| short | 2 bytes or 16 bits(same as char) |
| variables can have what but can't start with it | a number |
| what indicates input from a device in Java | System.in |
| importing Scanner syntax | import java.util.Scanner; |
| creating scanner syntax | Scanner input = new Scanner(System.in); |
| getting data from user syntax | x=input.next(); |
| Escape Sequence for newlin | \n |
| Escape Sequence for tab | \t |
| Escape Sequence for Ring Bell | \r |
| Escape Sequence for print special character | \\ \" \' |
| Syntax error | error that stops the program from comiling |
| Logic error | program runs but returns strange results |
| Run-time error | program stops because of not possible answers such as divide by zero |
| Given declaration Name name1; a call to displayName method would be | name1.displayName(); |
| Members declared as private can be accessed | buy the class they are created in |
| when is memory for a class allocated | when a reference to the object name is declared |
| Every Java application has at least one | public class |
| Method headers must contain | name, return type, parentheses () |
| how to round 99.95 with print statement | System.out.printf("%1.1f", 99.95); |
| printf statements for floats and doubles | %f %e |
| printf for int | %d |
| printf for char | %c |
| %e does what | prints scientific notation e+00 |
| Methods are | code that performs actions and returns data |
| Method Modifier | public, private static |
| Method return types | void, Boolean, int, double... |
| Can you increase String size automatically | Yes because all strings are reference variables |
| String sName.CompareTo("Thing") will return | a 0 if true and a 1 if false |
| String name = "Bob Jone"; char letter =name.charAt(2); returns | b |
| When is memory for an object alocated | when the object is instantiated Ex: Class objectname = new Class(); |
| default constructors take how many variables | none |
| Three ways to assign values to Strings | name="thing"'; name = new String("thing"); name=input.nextLine(); |