COMPLETE QUESTION
I. public class Test {
public static void main(String[] args){
System.out.println("Welcome to Java!");
}
}
II. public class Test { public static void main(String[] args) {System.out.println("Welcome to Java!");}}
Answer:
Both codes will compile and run and display Welcome to Java, but the code in II has a better style than I
Explanation:
When written codes, paying attention to proper coding styles and efficient memory management enables us to create programs that are highly efficient, coding styles refer to proper indentions and avoiding too lenghty lines of code (as is in code I), adding approprite comments etc.
You can compress them. ZIP is the most well known protocol.
Answer:
The correct answer to the following question will be 2. the operator new.
Explanation:
New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .
Syntax of using 'new' operator is :
class_name object_name=new class_name() // it allocated the memory to the class
For Example :
ABC obj = new ABC;
Now, this time obj points to the object of the ABC class.
obj = new ABC ();
call the construction of ABC class
I think the answer to this would be true
Answer:
The correct answer to the following question will be Option C (Volatile type of memory).
Explanation:
Random Access Memory, a variety of computer's memory which could be retrieved accidentally i.e., some memory can be obtained without any of the previous bytes being touched.
- Volatile memory is a type of a storage in computer that only retains its information or data while powering the appliance.
- Almost all of the RAM used in Pc's for the primary storage is unstable storage.
So, Option C is the right answer.