MTA Java QUESTIONS AND CORRECT ANSWERS 2022
MTA Java QUESTIONS AND CORRECT ANSWERS 2022getMessage Displays details of an exception IOException Occurs when a file being read from does not exist getStackTrace Returns an array of stack trace elements InputMismatchException Occurs when an incorrect data type is entered or read IllegalArgumentException Thrown by a method to indicate an illegal or inappropriate argument. IInt(args[0]); Converts a string of data to a whole number. protected method Can be called by any subclass within its class, but not by unrelated classes (same package only) private method can only be accessed by methods of the same class, is usually a helper method, and can never be a constructor ArrayL(i) a method of ArrayList class used to return the i item within an ArrayList. ArrayLe(i) a method of ArrayList class used to remove i item from an ArrayList and moves all following values up one space. conversion errors errors that arise form converting statements from one (non-equivalent) form to another (ie: setting a double to equal an integer). javac command loads a Java class from the command line java command runs a Java class from the command line (can contain raw numbers, no commas or percent symbols) SEmpty() Method checking if a String is empty (no null method) Byte Contains numbers from -128 to 127 Double 64 bit numbers with decimal points Long 64-bit whole number, pretty large Float Numbers whose decimals have the letter 'f' after it (also loses precision in a calculation) try-catch-finally block code from a try block that throws an exception will look for a corresponding catch block with code that handles the exception. Optionally a finally statement can be added to run clean-up code independent of the try-catch outcome. (One try can have either; There can be multiple catch blocks) static Argument that cannot be changed when declaring the main method; It takes one space in memory; (for a class to be called from a _______ method, it too must be ______, or runtime error ) printf A method of the System class that is capable of outputting formatted text. %d returns an integer as a decimal value %,d separates an integer with a comma as a thousands' separator .Scanner Loads the library to allow the user to take information into the code Scanner scan = new Scanner(S); Creates a Scanner object "scan" () Closes the scanner to prevent resource leaks ScannerT(ScannerT) Example of an error caused by a mismatch of data types while testing the Scanner utility, not in a "scanner" method (Checked exception) BString(); Converts a boolean to a String do-while loop repeatedly executes a block of statements until a specified Boolean expression evaluates to false. ternary conditional a shortened version of an if/else statement that returns a value based on the value of a Boolean expression (condition ? true : false) continue; keyword to skip a loop iteration break; keyword to exit a loop completely initial array usually empty as part of a main method nextLine the Scanner class's ______ method reads a line of input, and returns the line (or the remaining part of it) as a string Iterator an object containing data and methods to iterate through a collection of data, allowing processing of one data item at a time. Integer object declared for an integer to be used in an ArrayList immutable unchangeable (String property) DDouble(string) Converts a String to a double Nested branches The nested branches can tak
Written for
- Institution
- MTA - Microsoft Technology Associate
- Course
- MTA - Microsoft Technology Associate
Document information
- Uploaded on
- November 27, 2022
- Number of pages
- 4
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
mta java questions and correct answers 2022
-
getmessage displays details of an exception
-
ioexception occurs when a file being read from does not exist
-
getstacktrace returns an array of stack trace elem
Also available in package deal