
java 14-10-2023
Authored by DEVAKI AMIR
Computers
Professional Development
Used 5+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
package com.vq.classes;
class VQClassA {
public VQClassA(int x) {
this.x = x; }
protected int x; }
public class VQClassB extends VQClassA {
public VQClassB(int x, int x2, int y) {
super(x); x = x2; this.y = y; }
private VQClassB(int x, int y) {
super(x); this.x = x; this.y = y; }
private int x;
private int y;
public static void main(String[]args) {
VQClassA vqa = new VQClassA(10);
VQClassB vqb = new VQClassB(20, 10);
vqa = vqb;
System.out.println(vqa.x + " " + vqb.y); } }
10 10
10 20
20 20
20 10
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Java is an object oriented programming language which where you declare the class which is type of object you just identified. The objects have states and behaviours which are methods in class.
In java every thing is an object.
A java program consists of objects which interact to each other by sending messages.
An object can be build using other objects.
All
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
You only want to declare the behaviour of a certain type without any implemention , you should declare it as interface. In its most common form, an interface is a group of related methods with empty bodies.
package com.vq.inheritance;
public interface VQCourse {
public void printCourseDetail();
public void getCoursePrice(); }
VQJavaCourse extends VQCourse
VQJavaCourse implements VQCourse
Wrong Syntax.
Answer explanation
To implement this interface you'd use the implements keyword in the class declaration. Implementing an interface allows a class to become more formal about the behavior it promises to provide.
4.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which statement(s) is true about following program?
public class VirtuQCourseProvide {
public static void main(String[]args) {
String firstName = "VirtuQ";
String lastName = "Simplifying Education";
String FullName = firstName + lastName;
String courseProvider = FullName; }}
The statement courseProvider==FullName will evaluate to true.
The statement courseProvider.equals(FullName) will evaluate to true.
The statement courseProvider.equals(courseProvider==firstName+lastName) will evaluate to true.
The statement courseProvider.equals(courseProvider==firstName+lastName) will evaluate to false
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Choose correct equivalent statement of following code.
int[][] arr = new int[3][];
for (int i = 0; i < arr.length; i++)
arr[i] = new int[3];
int [][] arr = new int[3][];
int [3][] arr = new int[3][];
int [][3] arr = new int[3][];
int [][] arr = new int[3][3];
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Code below has class VQClassB which inherits another class VQClassA, study following code carefully and choose correct option about program output.
package com.vq.classes;
public class VQClassB {
class VQClassA {
public VQClassA(int x) {
this.x = x; } protected int x; }
public VQClassB(int x, int x2, int y) {
x = x2; this.y = y; }
private VQClassB(int x, int y) {
this.x = x; this.y = y; }
private int x;
private int y;
public static void main(String[]args) {
VQClassB vqb = new VQClassB(20, 10);
VQClassB.VQClassA vqa = new VQClassB(10, 10).new VQClassA(10);
System.out.println(vqa.x + " " + vqb.x); } }
10 10
10 20
20 20
20 10
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
class VQCourse {
public String courseName;
public int courseID; }
public class VirtuQCourseProvide {
public static void main(String[]args) {
VQCourse course1 = new VQCourse();
course1.courseID = 0001;
course1.courseName = "0001";
VQCourse course2 = new VQCourse();
course2 = course1;
System.out.println("course1.courseID = " + course1.courseID + ", course2.courseID = " + course2.courseID); }}
course1.courseID = 0001 course2.courseID = 0001
course1.courseID = course2.courseID = 1
course1.courseID = 1, course2.courseID = 1
course1.courseID = 0001, course2.courseID = 0001
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
QUIZ FAST- Auditor
Quiz
•
Professional Development
10 questions
Azure Cloud computing
Quiz
•
Professional Development
12 questions
tubitak-quiz-1
Quiz
•
Professional Development
10 questions
6. Method
Quiz
•
Professional Development
11 questions
Java Fundamentals
Quiz
•
Professional Development
15 questions
BrightChamps Technical Round - C language
Quiz
•
Professional Development
10 questions
02 - Python - Introduction & Installation
Quiz
•
University - Professi...
15 questions
CSS
Quiz
•
Professional Development
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
How to Email your Teacher
Quiz
•
Professional Development
6 questions
3RD GRADE DECLARATION OF INDEPENDENCE EXIT TICKET
Quiz
•
Professional Development
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
22 questions
Multiplying Exponents with the Same Base
Quiz
•
9th Grade - Professio...
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...