int a =12;
a += 3;
System.out.println(a);
// What is the output of the above program?-----
---------------
the Java keyword "new" accomplishes what?
starts a new program
gets input
creates an object in memory
refresh variable values
------------------------
Every Java Class MUST contain the main method: 'public static void main(String[]args)' true/false
int a = 12; //declaring variable a as integer and initializing it with 12.
a += 3; // a = a + 3 = 12+ 3 = 15.
System.out.println(a); // prints 15 to the console.
So the output of the above code is 15.
--------------
new is keyword used in java for creating an object in memory.
For example Car c = new Car() // it will create a car object inside memory.
So the answer is : creates a object in memory.
---------------
Answer is false.
Every class in java need not contain main method. In a java file only one class can contain a main method.
So the correct answer is false.
Get Answers For Free
Most questions answered within 1 hours.