Object Oriented
Which of the following is not the pillar of Object Oriented Programming
Abstracrtion
Encapsulation
Multithreading Programming
Polymorphism
Java compiler translates a java source file into a file containing
Byte code instruction
Machine code instruction
C code instructions
C++ code instructions
What is a Java virtual machine
A program emulating a microcontroller
A program emulating a microprocessor
A program emulating a RAM
It is a real maching to control the head from the laptop
What is system and what is out in System.out.println("HI")
System is object out is class
The system is class and out is object
System and out are both classes
System and out are both objects
The first character of an identifier may not be
A digit
A lowercase
An uppercase
An #
How many primitive data types are there in java
2
4
6
8
What does new operator do?
Dynamically allocates memory for an object during run time
Creates new type of class
Initializes variable
Declare a method
What is dialog box
Scanner class
JOptionPane class
String class
Integer class
How many classes in a java file can be public
1
2
4
8
Each CPU has its own machine language.
True
False
Assembler the first high-level language (higher than machine language).
T
F
In Object-Oriented programming, data is global to the procedure.
T
F
In Object-Oriented programming, procedures are called functions.
T
F
The term applet refers to bigger applications that are designed to betransmitted over the Internet from a Web server and then executed in a Web
T
F
JVM is called an Interpreter.
T
F
Java doesn't need a compiler; only JVM is enough.
T
F
A Java source code file can contain only one Java classes.
T
F
The print method puts a newline character at the end of the output.
T
F
Shadowing is discouraged in JAVA programming.
T
F
Which one of the following is not one of the four pillars in object-oriented programming ?
Encapsulation
Functions
Inheritance
Polymorphism
Java was first built in
Sun microsystem
Intel
Apple
Microsoft
JVM is a program emulating
Operating machine
Microprocessor
Full intel processor
It is not a program
To compile a java file named myJava.java we need to run this line in the command prompt
Javac myJava.java
Java myJava.java
Javac myJava
Java myJava.java
In the statement System.out.println("Programming is great fun!"); Out is an
A class of system class
An object of system class
Function
Variable
\t is an
Escape sequence and tab
Escape equence and new line
Not an escape seq
End of line char
The + operated is wrong in which option
System.out.println("Hello " + "World");
B. System.out.println("The value is: " + 5);
C. System.out.println("The value is: + value");
D. None
Which is a javadoc comment
/**..*/
//
/*...*/
\\
When a variable contains the memory address of the object's location, it is called
Reference
Primitive
Static
Private
Shadowing means
A. When a class has a field name the same as the field name in another
B. When a method has a local variable with the same name as an
C. When two methods in a class have local variables with the same
D. When you call a method outside of the class.
Whihc one of these is not an example of method overloading
A. Int sum (int a, int b)int sum (int a, int b, int c)
B. Int sum (int a, int b)float sum (int a, int b)
C. Int sum (int a, int b)nt sum (int… a)
D. Int sum (int a, int b)
In a class named House, a field is declared as private double rent; How will you show it in the UML diagram?
House +rent:double
House -rent:double(2nd and 3rd box
House -double:rent double
House -rent:double(1st and second box)
In a UML diagram, how can you show a constructor?
A. There is no unique way to write a constructor. All rules are the same as regular methods.
B. A method without the return type; other rules are the same as common methods.
C. You will write the constructor's name in all uppercase letters.
D. Constructors are not shown the UML diagram.
Which of the following is not one of the properties of a default constructor
Has no parameters to initialize an object
Sets all objects numeric fields to 0
Sets all objects boolean fields to true
Sets all others objects reference variables to the special value null
You can create string object by
String name = new String("Welcome All");
String name = "Welcome All";
Both
None
7. Open and close parenthesis () is used in class header for class declaration
True
False
8. You can use a java reserved keywords as a class name.
T
F
9. 12abc cant be a class name.
T
F
10. Parse method can convert string(“700”) to 700.
T
F
11. A void method usually returns an integer type variable.
T
F
12. In an UML diagram private variables are denoted as +(plus) variable.
T
F
13. In an UML diagram method return types are placed after the method declaration name, separated by a colon.
T
F
14. Shadowing is highly encouraged for JAVA programming.
T
F
15. There is no way you can show a constructor in an UML diagram.
T
F
Encapsulation is one of the pillars of procedural programming.
True
False
In JAVA language we don’t need a compiler to compile
True
False
Nt value=5; In the declaration above value is literal and 5 is a variable
True
False
Procedural programming is focused on creating objects rather that procedure
True
False
Two types of programs that may be created with Java: applications and applets
True
False
JVM creates byte code instruction
True
False
In Java each character is
2 byte
4 byte
1 byte
8byte
Which has highest precedence
Binary multi
Binary plus
Unary plus
Modulus
When a variable contains the memory address of objects location it is called
Reference variable
Primitive var
Static var
Private var
What does new operator do
Convert old var to new
Acquire actual physcial copy of object
Create static var
Create copy of an object
What is constructor of class
A. A class of the same name of the class
B. A method of the same name of the class
C. A variable of the same name of the class
D. A package of the same name of the class
Constructor is primarily used ofr
A. Returning a variable
B. Initialization of the fields of a class
C. It works like a jump statement
D. Importing a new file to a class
Default constructor has
One param
Three param
None
Have varargs argument
Which is not an example of method overloading
Int sum int sum
Int sum float sum
Int sum int sum
Int sum int sum
{"name":"Object Oriented", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Which of the following is not the pillar of Object Oriented Programming, Java compiler translates a java source file into a file containing, What is a Java virtual machine","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
More Quizzes
Praktis intensif PT3 (objektif)
8474
Serial Quizzer Day 6
520
SDP Finals
138690
Geld und Finanzen
7424
How well do you know Zara?
740
5/6/2019
100
Get to Know Me Better!
1586
How well do you know Ash?
10519
210
Quiz l ontdek op welke aap soort je het meest lijkt
320
Trémula Terra
1160
Daily Routines. Test your understanding!
1050