How does Java "compilation" work from the moment you give the "javac" command?
Java uses a "Just-in-Time" (JIT) compiler. This technique saves time by compiling related portions at the same time. When you enter "javac" with the filename as an argument and press [Enter], Java translates the Java code to "bytecode". This is a very shortened and condensed version of the original program. It takes out everything unnecessary and may even remove variables and optimize everything it can automatically. If you look at the output ".class" file, you will notice it's mostly gibberish. That's OK! We don't need to be able to read it; only your computer does! When a computer goes running a compiled Java program, it has the bytecode translated to machine code for that computer's specific hardware, and the program is then run.
Using Standard SQL, please give a list of commands you would use to output the command used to create a table. In this particular instance, we are using the DBMS MySQL. We have a user "usr" and a root password "r00t". The database we're looking at is called mydata and the table is mytable. We need to get the code to recreate an empty version of mytable.
This is a more practical problem involving SQL. In order to do this problem, we will need to know how to do the following (if you do not, please feel free to find them in the SQL Manual or simply Googling it!): 1. Log into SQL 2. Navigate to a database within a commandline 3. Navigate to a table within a commandline 4. The proper command to output this code This is actually a fairly common problem for people writing web apps, so it will definitely behoove you to know how to do this! First, we use the command: > MySQL -u usr -p Then, we will be prompted for the password and enter it in. Next, we use: > USE mydata; Note that the command words themselves are NOT case-sensitive in SQL. Next, we use: > SHOW CREATE TABLE mytable; At this point, the console will output the text (with a few peculiarities) that you can copy and save as a .sql file and later use to recreate an empty version of that table!
In Java, primitive arrays take in the "index" in order to be able to return a value. For example, let's say we have an array of integers called "myInts". If we wish to place something at key 5, we use the notation myInts = 0; What is the SMALLEST possible size of this array?
In order to answer this question, we must understand the basic anatomy of a Java array. It is a bit of a trick question for newer programmers, because we must understand that the array is zero-indexed. This means that there is indeed something stored in myInts. If we know that the statement myInts = 0 is valid and properly assigns 0 to the 5 key, then we know there must also exist myInts, myInts, myInts, myInts, and myInts. Therefore, the smallest possible size of the array "myInts" would be 6.