fundamental of java programming coursera week 1 quiz answers
Java Basics - Practice Quiz
1. Which of the following is a feature of Java?
- Compiled language
- Static typing
- Dynamic memory allocation
- Garbage collection
2. Which of the following is a difference between C++ and Java?
- Memory management
- Syntax
- Platform independence
- Object-oriented programming (OOP) features
3. Which of the following is a feature of Java?
- Multiple inheritance
- Operator overloading
- Templates
- Exception handling
4. Which of the following is a difference between C++ and Java?
- Memory management
- Syntax
- Portability
- Object-oriented programming (OOP) features
5. Which of the following is a feature of Java?
- Pointers
- Multiple inheritance
- Operator overloading
- Bytecode compilation and interpretation
Java Fundamentals - Graded Quiz
6. What is JVM in the context of Java?
- Java Virtual Machine
- Java Runtime Environment
- Java Development Kit
- Java Compiler
7. What is JRE in the context of Java?
- Java Virtual Machine
- Java Runtime Environment
- Java Development Kit
- Java Compiler
8. What is JDK in the context of Java?
- Java Virtual Machine
- Java Runtime Environment
- Java Development Kit
- Java Compiler
9. What is the main function of JVM in Java?
- To compile Java source code into Java bytecode.
- To execute Java bytecode and run Java programs.
- To provide a development environment for Java programmers.
- To manage memory and garbage collection in Java programs.
10. What is the purpose of the "public static void main(String[] args)" in a Java program?
- To define the entry point of a Java program.
- To define a static method in a Java class.
- To define a public method in a Java class.
- To define a void method in a Java class.
11. What are the features of Java that make it platform-independent?
- Dynamic Typing and Reflection
- Garbage Collection and Exception Handling
- Bytecode and JVM
- Polymorphism and Inheritance
12. What is the main purpose of the Common Language Runtime (CLR) in .NET framework?
- To compile C# source code into machine code.
- To manage memory, handle exceptions, and provide common language services.
- To provide a development environment for .NET programmers.
- To define the syntax and semantics of .NET languages.
13. What is the purpose of the .NET Framework Class Library (FCL)?
- To provide a development environment for .NET programmers.
- To provide a set of pre-built classes for common tasks such as file I/O, networking, and XML processing.
- To define the syntax and semantics of .NET languages.
- To manage memory and handle exceptions in .NET applications.
14. Which of the following is NOT an application of CLR (Common Language Runtime) in .NET framework?
- Garbage collection
- Just-in-time compilation
- Exception handling
- Compilation of C# source code into machine code
15. Which of the following is NOT a feature of Java?
- Platform independence
- Object-oriented programming
- Garbage collection
- Multiple inheritance
16. Which of the following is NOT a feature of C++?
- Static typing
- Object-oriented programming
- Operator overloading
- Automatic garbage collection
17. What is the main difference between C++ and Java in terms of memory management?
- C++ uses automatic garbage collection, while Java uses manual memory management.
- Java uses automatic garbage collection, while C++ uses manual memory management.
- Both C++ and Java use automatic garbage collection for memory management.
- Both C++ and Java use manual memory management for memory management.
18. Which of the following is NOT a part of Java Development Kit (JDK)?
- Java Virtual Machine (JVM)
- Java Runtime Environment (JRE)
- Java Compiler
- Java Debugger
19. Which of the following is NOT a feature of Java Virtual Machine (JVM)?
- Just-in-time (JIT) compilation
- Platform independence
- Memory management
- Execution of C++ code
20. What is the purpose of JRE (Java Runtime Environment) in Java?
- To compile Java source code into bytecode.
- To execute Java bytecode on the JVM.
- To provide tools for developing Java applications.
- To provide a development environment for writing Java code.
21. Which of the following is NOT a component of JDK (Java Development Kit)?
- Java Compiler
- Java Virtual Machine (JVM)
- Java Runtime Environment (JRE)
- Java Class Libraries
22. What is the purpose of the "class" keyword in Java?
- To define a class.
- To define a method.
- To declare a package.
- To create an object.
23. Which of the following is an application of Common Language Runtime (CLR) and Framework Class Library (FCL) in C#?
- Database connectivity
- User interface design
- File handling
- Networking
24. Which of the following is NOT a feature of Java programming language?
- Platform independence
- Object-oriented programming (OOP)
- Garbage collection
- Pointers
25. Which of the following is a difference between C++ and Java?
- C++ supports multiple inheritance, while Java does not.
- Java supports operator overloading, while C++ does not.
- C++ does not have a garbage collector, while Java does.
- Java allows for direct memory manipulation, while C++ does not.