Introduction To Java Questions Answers - MyCSTutorial - in - The Path To Success in Exam..

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Introduction to Java Questions Answers


/ Class 12 Information Technology 802, Java Question Answer / By mycstutorial / March 17, 2023

Class 12 Information Technology Code 802

Introduction to Java – Important Question Answer

Que 1. What is Computer Program?

nolata
Katalon

Get the Full Report olataK


Open

Answer: A computer program is a sequence of instructions given to the


computer in order to accomplish a specific task. The instructions tell the
computer what to do and how to do it.

Interior Designing Institute


17 Years Of Legacy. Placement Assistance.
Free Demo Class Available. Call Now for
booking.

IIFT Bhopal Open

Que 2. Give the example of five high-level programming languages.


Answer: Java, C++, Python, Ruby or Scala.


https://mycstutorial.in/introduction-to-java-questions-answers/ 1/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Que 3. Which language does a computer understand?


Answer: Machine Language
Que 4. What is a Compiler?
Answer: Compiler is a language processor which translates high-level
language to machine language code that a computer can understand.
Que 5. What is Java?
Answer: Java is a High-Level Object Oriented programming language and
has been used widely to create various types of computer applications
such as database applications, desktop applications, Web-based
applications, mobile applications, and games among others.

Get Java Help. Give Java Help.

Get Your Math


Problems Open
Answered For Free
he.net

Que 6. What is Java Compiler?


https://mycstutorial.in/introduction-to-java-questions-answers/ 2/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Answer: A Java compiler that translates Java Source Code into Java
Bytecode (a highly optimized set of instructions). Like other language
compilers (c, c++), it does not translate Java code to machine language
code.
Que 7. What is Java Interpreter / JVM?
Answer:  Java Interpreter is known as JVM (Java Virtual Machine). Java
Interpreter translates the Java bytecode into to the respective machine
code as per the operating system and then executes it.
Que 8. What is the need of JVM?  [SQP]
Answer: When the bytecode (also called a Java class file) is to be run on
a computer, a Java interpreter, called the Java Virtual Machine (JVM),
translates the bytecode into machine code and then executes it.
Que 9. Why java is platform independent and portable? [CBSE 2018]
Answer:  The advantage of JVM is that once a programmer has compiled
a Java program into bytecode, it can be run on any platform (say
Windows, Linux, or Mac) as long as it has a JVM running on it. This
makes Java programs platform independent and highly portable.
Que 10. Write the full from of IDE? What is IDE?
Answer:  IDE stands for Integrated Development Environment. IDE is an
integrated development environment, which combines the text editor
and java compiler. It simplifying writing, compiling and executing java
programs.

https://mycstutorial.in/introduction-to-java-questions-answers/ 3/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Nissan Magnite GEZA @7.39L


This June, bring home the India inspired SUV
Nissan Magnite GEZA. Click to book now
@7.39L

Nissan India Contact Us

Que 11. Give one example of IDE.


Answer: Java NetBeans IDE.
Que 12. Write the extension of Java source code and java bytecode
file.
Answer: Java Source Code: – .java  ; Java bytecode (class file) :- .class
Que 13. What is comment? How many ways you write comment in
java?
Answer: Comments are non-executable statement, are used in code to
document the program. Especially useful for writing the purpose of the
program, so that anyone can understand it.
Comments are used for enhancing the readability of code and are
ignored by the compiler when compiling a file.
You can write comments in a Java program in the following two ways:
(a) Beginning a comment line with two consecutive forward slashes (//)
(b) Writing the comment between the symbols /* and */
Que 14. How can you write single-line comments in java?
Answer: In Java single-line comment can be written by using // at the
beginning of line. For example
// is used to write a single-line comment. 

https://mycstutorial.in/introduction-to-java-questions-answers/ 4/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

// this is a single-line comment


Que 15. How can you write multiline comments in java program?
Answer: In Java, the multi-line comment can be written by /*  ….. */. You
need to start the comment by /* and end by */.
For example:
/* This is an
example of
a multiline comment. */

Build and Deploy


Learn More
ML Models
TensorFlow

Que 16. What is package?


Answer: A package in java is a group of related classes. All classes in a
package can share their data and code. Package declaration statement
is the first statement in the java program.
package MyJavaProgram ;
Que 17. Why main() is special method of java?
Answer: main() function is very important component of java
application program, because the execution of program is always
started from the main() function.
Que 18. Which function is used to print the statement? 

https://mycstutorial.in/introduction-to-java-questions-answers/ 5/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Answer: println() and print() function of java is use to print the message
and value of variable.
Que 19. Differentiate between System.out.print( ) and
System.out.println().
Answer: System.out.print() is print the message and leave the cursor
in the same line, while System.out.println() is print the message and
move the cursor to the next line.
Que 20. Which symbol is used in jave at the end of the statement?
Answer: The semicolon ; at the end of the statement. All Java
statements must end with a semicolon.
Que 21. ________ translates the byte code into machine code and
then executes it. [SQP]
Answer: Java Virtual Machine (JVM)
Que 22. _______________ is a special method that every Java application
must have. [SQP]
a. Getter       b. Setter        c. Main          d. Default
Answer: Main

Interior Designing
Open
Institute
IIFT Bhopal

Que 23. Define JVM. [SQP]


https://mycstutorial.in/introduction-to-java-questions-answers/ 6/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Answer: Java Virtual Machine (JVM), translates the bytecode into


machine code and then executes it.
Que 24. What are comment entries in Java? Mention two ways to
give comments. [SQP]
Answer: Comments are used in code by programmers to document
their programs – to provide explanatory notes to other people who read
the code. This is especially useful in the real world, where large
programs are written by one programmer and maintained by other
programmers.
Beginning a comment line with two consecutive forward slashes (//)
Writing the comment between the symbols /* and */
Que 25. Why Java program is platform independent?      [SQP}
Answer: A Java compiler instead of translating Java code to machine
language code, translates it into Java Bytecode. A Java interpreter, called
the Java Virtual Machine (JVM), translates the bytecode into machine
code and then executes it. The bytecode can be run on any platform as
long as it has a JVM running on it. This makes Java programs platform
independent and highly portable. (keywords bytecodes and JVM to be
included)
Que 26. How can you write multiline comments in java program?
 [SQP]
Answer: Writing the comment between the symbols /* and */

https://mycstutorial.in/introduction-to-java-questions-answers/ 7/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Que 27. Why main is a special method in the java program?  [SQP]
Answer: Main is a special method that every Java application must have.
When you run a program, the statements in the main method are the
first to be executed
Que 28. Why a Compiler is needed?
Answer: As you are already aware, a computer only understands its
own language called “machine language”. Therefore, a compiler is
needed to translate high level program code into machine language
code that will be understood by the computer.
Que 29. Why we need to compile a program on every platform like
Windows or Mac before execution of Program?
Answer: All platform/OS (windows, Mac) has different instruction sets,
compiler is always generating the executable code as per platform. So it
is required to compile every program before execution on each platform
separately.
Que 30. What is the extension of Java Program File?
Answer: .java
Que 31. What is the extension of Java Bytecode File or Class File?
Answer:  .class

https://mycstutorial.in/introduction-to-java-questions-answers/ 8/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Que 32. What is method?


Answer: A method is a group of statements written to perform a
specific task. The method body is enclosed within a pair of curly braces
and contains the statements that the method will execute.
Que 33. What is the error in the given statement?
    SystemOUT.println(“Hello world”);
Answer: OUT must be ‘out’, and a dot (.) will come between System and
out. The correct code is –
System.out.pirntln(“Hello World”);
Que 34. What is the error in the given statement?
    System.out.println(“Hello world”)
Answer: Missing of semicolon at the end of the statement.
In java every statement must be terminated with semicolon. The correct
code is –
System.out.pirntln(“Hello World”);
Que 35. What is the error in the given statement?
    System.out.printl(‘Hello world’)
Answer: (i) printl() is not a valid function name, it should be println(), to
print the line and move the cursor to the new line.

https://mycstutorial.in/introduction-to-java-questions-answers/ 9/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

(ii) Single quote ‘’ is used for character constant, So Hello World must be
enclosed with double quotes. “”.
System.out.pirntln(“Hello World”);

Que 36. Is Java a case sensitive language? Justify your answer. [CBSE
2019]
Answer: Yes, Java is a case sensitive language.
In java, ‘A’ and ‘a’ both values are treated as different because both have
different ASCII / UNICODE value.
Que 37. Write any three applications where java is used. [CBSE 2017
COMPT]
Answer: Three applications are – Database applications, Desktop
applications,
Web based applications, Mobile applications, and Games, etc.
Que 38. Java programs are   [CBSE 2017]
(a) Faster than others
(b) Platform independent
(c) Not reusable
(d) Not scalable 

https://mycstutorial.in/introduction-to-java-questions-answers/ 10/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Answer: (b) Platform independent


Que 39. Java has its origin in  [CBSE 2017]
(a) C programming language
(b) PEARL
(c) COBOL
(d) Oak programming language
Answer: (a) C Programming language

Que 40. Which one of the following statements is true for Java ? 
[CBSE 2017]
(a) Java is object oriented and interpreted.
(b) Java is efficient and faster than C.
(c) Java is the choice of everyone.
(d) Java is not robust.
Answer:  (a) Java is object oriented and interpreted.
Que 41. OOP features are   [CBSE 2017]
1. Increasing productivity
2. Reusability 

https://mycstutorial.in/introduction-to-java-questions-answers/ 11/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

3. Decreasing maintenance cost


4. High vulnerability
(a) 1, 2 and 4 only
(b) 1, 2 and 3 only
(c) 2, 3 and 4 only
(d) None of the above
Answer: (b) 1, 2 and 3 only
Que 42. A byte code in Java is _________.
(i) Another name for Java source file that contains the information about
the hardware.
(ii) A binary code that is generated by JVM for operating system.
(iii) An intermediate code generated by Java compiler for JVM.
(iv) None of these
Answer: (iii) An intermediate code generated by Java compiler for JVM.
Que 43. Expand IDE. Name any one open source IDE for writing Java
programs.
Answer: IDE stands for Integrated Development Environment.
Open Source IDE for writing Java Program –  NetBeans, Eclipse, IntelliJ
IDEA, Code::Blocks, etc.

https://mycstutorial.in/introduction-to-java-questions-answers/ 12/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Que 44. Write any four best features of Java. [CBSE 2019 COMPT]
Answer: Four best features of Java are: –
(a)      Simple
(b)      High Level Object Oriented Programming Language
(c)      Highly Portable
(d)      Platform Independent
(e)      Secured Language
(f)       Architectural Neutral
(g)      Robust

← Previous Post Next Post →

Related Posts

https://mycstutorial.in/introduction-to-java-questions-answers/ 13/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 Information Technology 802 Term 1 2021-22 Examination


Question Paper with Answer Key
Class 12 Information Technology 802 / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 14/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 IT 802 Unit 3 Fundamentals of Java – Important Questions


Answers
Class 12 Information Technology 802, Java Question Answer / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 15/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 Information Technology Code 802 Important Questions


Answers
Class 12 Information Technology 802 / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 16/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 Information Technology 802 Term 2 2021-22 Board


Examination Question Paper with Answer Key
Class 12 Information Technology 802 / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 17/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 IT 802 Unit 1 : Database Concepts – Basics of RDBMS Question


Answer
Class 12 Information Technology 802 / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 18/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 IT 802 Unit 1: Database Concepts – SQL Table Creation and


Manipulation Commands Question Answer
Class 12 Information Technology 802 / By mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 19/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 IT 802 Unit 1 Database concepts NCERT Book solution


Class 12 Information Technology 802, Class 12 Information Technology 802 NCERT Book Solution / By
mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 20/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Class 12 IT 802 Unit 3 Fundamentals of Java Programming NCERT


Book solution
Class 12 Information Technology 802, Class 12 Information Technology 802 NCERT Book Solution / By
mycstutorial

https://mycstutorial.in/introduction-to-java-questions-answers/ 21/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Recent Posts

Class 10 Employability Skills Unit 2 Self Management Skills – II Study Material Notes
Class 9 Employability Skills Question Answer based on NCERT Textbook
Class 9 Employability Skills Multiple Choice Questions MCQ based on NCERT Book
Class 9 Employability Skills NCERT Textbook Solution
Class 9 Employability Skills Unit 5 Green Skills NCERT Book Solution

https://mycstutorial.in/introduction-to-java-questions-answers/ 22/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

https://mycstutorial.in/introduction-to-java-questions-answers/ 23/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Search … 

Join Our Community


Enter your email address to register to our newsletter subscription delivered on regular basis!

MyCSTutorial is working for free education for all. We are try to provide educational aids free of cost, 
study material, sample papers and so many other things also.
Our only moto to help the students without any trouble or cost.

Follow Us    

CBSE Popular Links

 CBSE Curriculum 2022-23

 Class 12 SQP & MS 2022-23

 Class 10 SQP & MS 2022-23

 9 to 12 CBSE Study Material Links 22-23

 CBSE Class 10 Question Bank 21-22

 CBSE Class 12 Question Bank 21-22

 CBSE Term-2 Question Bank 21-22 (KVS Raipur)

 CBSE Term-1 Question Bank 21-22 (KVS Raipur) 

 CBSE Term-1 Question Bank 21-22 (KVS Hyd)


https://mycstutorial.in/introduction-to-java-questions-answers/ 24/25
6/26/23, 3:11 PM Introduction to Java Questions Answers - MyCSTutorial.in | The Path to Success in Exam...

Quick Links

 Computer Science

 Informatics Practices

 Information Technology

 Artificial Intelligence

 Computer Application 165

Contact Info

Phone
+91 8221909045
Email
[email protected]

COPYRIGHT © 2023 MYCSTUTORIAL.IN | THE PATH TO SUCCESS IN EXAM...


POWERED BY ANJEEV SINGH

https://mycstutorial.in/introduction-to-java-questions-answers/ 25/25

You might also like