click below
click below
Normal Size Small Size show me how
OOP m2
m2 ng oop mga fokers, di to formative
| Question | Answer |
|---|---|
| defines a class, a template for an object of derived type HelloWorld | class HelloWorld |
| access specifier, the main method is declared ______ so that it is accessible as part of the public interface of the program. | public |
| state of the method, in main method, it is _____ because it must be called before the class that hosts the method is instantiated | static |
| in main method, It returns ____ because the Java interpreter does not expect to receive or process any output from the class. | void |
| the Java interpreter does not expect to receive or process any output from the main class t or f | t |
| The System class is a part of the core Java language package of the ____ | Application Programming Interface (API) |
| are names that are given by the programmer as name of variables, methods or functions, classes etc. | identifiers |
| in identifiers, First character can be a digit t or f | f, cant be digit |
| identifier name must not be a reserved word. t or f | t |
| how to make javadoc comment | /** stuff */ |
| what are the: width (in bytes) min value max value of bytes | 1 -128 127 |
| what are the: width (in bytes) min value max value of short | 2 -32something 32something - 1 |
| what are the: width (in bytes) min value max value of int | 4 -2147something 2147 something - 1 |
| what are the: width (in bytes) min value max value of float | 4 float min value float max value |
| what are the: width (in bytes) min value max value of long | 8 long min val long max val |
| what are the: width (in bytes) min value max value of double | 8 dobol min val dobol max val |
| what are the: width (in bytes) min value max value of bool | 1 bit true false |
| what are the: width (in bytes) min value max value of char | 2 unsigned \u0000 \uffff |
| what are derived data types | Derived Data Types String Date Integer Double Long Float |
| are used in converting one data type (such as a String) into another data type (such as int or double). It is also used in wrapping a primitive value into an object. | java wrapper class |
| how to convert primitive to wrapper class? | anohin mo lang, complete the word, int -> Integer char -> Character boolean ->Boolean |
| java output types | sout print sout println sout printf |
| in sout System is a ____ | class |
| in sout out is a | public static field: it accepts output data. |
| int age = 25; String name = "Alice"; System.out.printf("Name: %s, Age: %d%n", name, age); what is output | Name: Alice, Age: 25 |
| in printf what is those % things like %d etc | %d Integers %s Strings %f: Floating-point numbers %x: Hexadecimal integers %o: Octal integers %c: Characters %e Floating-point numbers (scientific notation) %% Literal `%` character |
| scanner class found in what package | java.util |