Java Architecture and Concepts Quiz

BoundlessLeaningTowerOfPisa avatar
BoundlessLeaningTowerOfPisa
·
·
Download

Start Quiz

Study Flashcards

23 Questions

What is the main concept of encapsulation?

Data Hiding

What is the type of architecture that Java supports?

Multi-tier architecture

To achieve encapsulation, how should variables be declared?

Private

What does 'Neutral Robust' mean in the context provided?

Resilient and durable

In object-oriented programming, what do 'Class and object' represent?

Data structures

Which inheritance is known as having one parent class and multiple child classes?

Hierarchical

Does a constructor have a return type?

True

What is another term for Compile time polymorphism?

Static Binding

Which type of inheritance is not supported in Java?

Multiple Inheritance

What is the name of the component in JDK used to find errors in a Java program?

Jdb

What is the better approach when the number of arguments to pass in a method is unknown?

Variable arguments (varargs)

What is the smallest individual unit of a program known as in Java?

Token

What is the term used when a child class overwrites a method of the parent class?

Overriding

What is the purpose of 'Javac' in Java?

Compiler of Java code

What is the term for a constructor with no arguments?

Default constructor

How are static variables different from non-static variables?

Static variables are accessed by static methods only

How is runtime polymorphism achieved in Java?

Dynamic Binding

What is the term used to describe exiting from a specific case when it is inside another 'if' statement?

Nested if

Which loop executes its statements at least once without checking the condition initially?

Do-while loop

What is the term for converting one data type into another data type in programming?

Data conversion

Which type of loop has a terminating semicolon at the end of its structure?

Do-while loop

What are the jumping statements available in Java for altering the flow of control?

'Break' and 'continue'

Which type of array stores data in a matrix form with both row and column sizes defined?

Multi-dimensional array

Study Notes

Java Basics

  • Java supports Neutral/Robust architecture
  • Java is an Object-Oriented Programming (OOP) language

Java Compiler and JDK Components

  • javac is the compiler of Java
  • Javah is the component of JDK that produces header files
  • Java is the component of JDK used to execute or run the application
  • Jdb is the component of JDK used to find errors in the program

Java Program Structure

  • A Java program should have the same name as the class name
  • Java programs should be saved with a .java extension
  • NetBeans and Eclipse are provided by Java as editors or platforms

Data Types

  • Short requires 16 bits (2 bytes)
  • Int requires 32 bits (4 bytes)
  • Boolean data type can only have values of true or false
  • Char requires 16 bits (2 bytes)

Tokens and Operators

  • There are 5 types of tokens in Java: Variables, Operators, Keywords, Special Characters, and Literals
  • Literals mean the actual value
  • Assignment Operator is also known as the Shorthand Operator
  • Conditional Operator is also known as the Ternary Operator
  • Instanceof is the operator used to test whether an object is an instance of the specified type
  • Relational operator is also known as the Comparison operator

Control Structures

  • Switch case is used when we have multiple options
  • Break in switch case is used to exit the switch block
  • Class is a template from which objects are created
  • Encapsulation is the wrapping of variables and methods in a single unit
  • The main concept of encapsulation is Data Hiding

Inheritance

  • The parent-child concept is known as Inheritance
  • The main advantage of inheritance is Reusability
  • Multiple Inheritance is not supported in Java
  • Hierarchical inheritance has one parent class and multiple child classes
  • Multilevel inheritance is a combination of more than one type of inheritance

Polymorphism

  • Compile-time polymorphism is also known as Static binding
  • Runtime polymorphism is also known as Dynamic Binding
  • Method overloading is a type of compile-time polymorphism

Constructors

  • A constructor has the same name as the class name
  • A constructor does not have a return type
  • A constructor with no arguments is known as the Default constructor
  • A constructor with parameters is known as the Parameterized constructor

Static Variables

  • Static variables can be accessed by both static and non-static methods
  • Static variables are like global variables
  • Non-static variables are like local variables

Variables and Methods

  • Varargs uses ellipsis (…)
  • Varargs is used when the number of arguments is unknown

Loops and Jumping Statements

  • A do-while loop is known as an Exit controlled loop
  • A for loop is known as an Entry controlled loop
  • Break and Continue are the jumping statements in Java
  • Break is used to immediately exit from a loop or program

Test your knowledge on Java architecture, concepts, and components with this quiz. Questions cover topics like Java compiler, JDK components, naming conventions, and file extensions.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser