As the title says, it will output the learning content with the aim of acquiring Java Oracle Silver. Specifically, I will try to solve the so-called black book and describe the place where it gets stuck in this article. Therefore, please note that it is a memorandum for yourself rather than an article.
(2019/9/28): The description has been changed a little. (2019/10/29): Passed
Textbook: Thorough capture Jaca Silver SE8
Actually, I received it around the middle of the year ... The update was delayed. The correct answer rate was ** 91% **. Is it an easy victory ...?
As for the impression, ... ** "Problem collection, that's right ..." ** is a straightforward impression. No really. I didn't have enough time to review what I made a mistake the day before or just before, but I didn't get anything like a hook, and the answer options didn't change. I think.
Just one point, if you tell the recipient from now on, ** Be careful not to be confused by the variable name etc. ** ** Regarding the variable name, the method of assigning it is different from the problem collection ... So when you see the first question, you may be impatient with an unfamiliar variable name (I was confused for a moment). But that problem, I just did it in the problem collection! If that happens, I think it will be easier to solve, so please take it with confidence.
To be honest, the standard is 70% for the two summarization problems, and I think that all you have to do is review the mistakes. If there is something you don't understand, use the purple book. If you don't have the time, I recommend buying a Kindle and reading it on the train. I think it depends on the person, but for reference.
Although you can actually omit the description of the package, in that case ** it belongs to the anonymous package **, so the word ** does not belong to the package ** is not appropriate and incorrect.
You can only access anonymous packages from similar anonymous packages. Note.
An example is shown below.
☓:import static hoge6.ClassName.method() ○:import static hoge6.ClassName.method → This is the same for variables
What is static import in the first place? → ** A way to simplify calling external static members ** For example: ○ No static import
return Math.pow(4, 3)
○ With static import
import static java.lang.Math.pow;
return pow(4, 5)
If the question is Java source code, you need a compiler, but if it's bytecode, you don't.
What is Java bytecode? Intermediate code generated after compiling Java source code I remember that I don't need a compiler because it shows the code that has already been compiled after all.
Below is a list Primitive type: byte, short, int, char Reference type: Byte, Short, Interger, Character, String
Do you misunderstand that protected doesn't see much from the feeling of letters ... The access range is as follows
Access modifier | Access range |
---|---|
public | No limit |
protected | Only from the same class and subclass |
No description | Only from the same class and the same package |
private | Only from the same class |
You can do the following
//Three arrays are created, in which an array of length 5 is created.
int[][] array = new int[3][5];
//Such an image →[new int[5], new int[5], new int[5]]
//Initialize it
//Even small ones
array[0] = new int[1];
//Large ones
array[1] = new int[7];
//result
// [new int[1], new int[7], new int[5]]
int in = 5;
double do = 10.5;
//int → double is possible → because there is no data loss
int i = do;
//double → int is not possible → due to missing data (0).5 disappears)
double d = in;
//NG even in the following cases (meaning that "possible data loss" type conversion is not implicitly allowed)
double dou = 10.0
int n = dou;
//Checked exceptions: Throws declaration is always required, including when explicitly throwing an exception, and the caller must also catch.
public void hoge() throws Exception{
return new Exception()
}
//Unchecked Exception: No Throws Declaration Needed, No Need to Catch Anything
public void hoge() {
return new RunTimeException()
}
arraycopy(array1, x, array2, y, z)
//array1: Copy source array
//x: Where to start copying
// array2:Copy destination array
// y:Where to copy from the copy destination array
// z:"Copy source"Specify the number of characters to copy
Well, if you understand it properly, you'll understand ... For example, if it is an integer type, there are the following primitive types. byte,short,int,long These have different sizes, and the order of their sizes is as follows byte < short < int < long As mentioned above, implicit type conversion is only normal if ** "no data loss" **. Then, int → short with a value larger than the size of the short type may cause ** “data loss” **.
The relationship is described below.
byte < short < int < long
float < double
char → int, long, float, double (probably because there is no character code that fits in the size of byte)
double, boolean
Recommended Posts