• Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Have any question?

(+91) 98222 16647
info@simplycoding.in
RegisterLogin
Simply Coding
  • Home
  • Courses
  • School
  • Programs
  • Problems
  • Contact Us
  • My account
  • Register

Java Introduction

Java Theory – Java Basics

  • Categories Java Introduction, Introduction to Java

Here we are going to learn above Java Programming Language. You can watch our video on What is Java – Click Here

Q.1 What is Java?
Ans. Java is a simple and powerful high level, object oriented programming language.  Java originated at Sun Microsystems, Inc. in 1991. It was developed to provide a platform-independent programming language. 

Q.2 Who conceived Java?
Ans. It was conceived by James Gosling and was initially called ‘Oak’

Q.3 Why is Java called as platform Independent Language?
Ans. Java was designed with a concept of ‘write once and run everywhere’. Unlike many other programming languages including C and C++ when Java is compiled, it is not compiled into platform specific machine code, rather it is converted into platform independent byte code. This byte code is distributed over the web and interpreted by virtual Machine (JVM) on whichever platform it is being run.

Q.4 What is the difference between compiler and interpreter?
Ans. 

CompilerInterpreter
The program that translate the source program or source code to machine language or low-level language at once is known as compiler.The program that translate the source program or source code to machine language or low-level language step by step or line by line is known as interpreter.
Faster execution of control statements as compared to the interpreter.Slower execution of control statements as compared to the compiler.
Detected errors in the program get displayed after the entire program is read by compiler.Detected errors in the program get displayed after each instruction read by the interpreter.
Example: C++, Java.Example. Python, PHP.

Q.5 What are advantages of object oriented programming? / Why is Java called as Object Oriented Language?
Ans. Unlike procedural languages, in Java we can create objects, which offer many advantages:

  • Objects are created on real world entities.
  • Complex systems of real world can be converted into software solutions.
  • Objects can be easily reused in other programs due to its re-usability feature.
  • Objected oriented programs focuses the developer to do extensive planning which will reduces programming flaws and better design.
  • Software maintenance of the object oriented program is easier than as compared with structured oriented programming.

Q.6 What is the difference between source code and object code?
Ans.

source codeobject code
The set of instructions and statements written by computer programmer using a programming language to find solution of problem is known as source code or programThe machine language program produced after the compilation of the source code is known as object code or object module or object program.
Human ReadableMachine Readable
Created by the programmerCreated by the Compiler

Q.7 What is Byte Code?
Ans. Byte code is also called as intermediate code.  Java byte code is byte long instruction set that Java compiler generates and stores in .class files. Java compiler converts Java source code into platform independent bytecode. It needs JVM to execute byte code to run.

Byte code

Q. 8 What is JVM?
Ans. The java run-time system which translates or interprets byte code into machine code is known as Java Virtual Machine (JVM) or java Interpreter.
A JVM can either interpret the bytecode one instruction at a time or the bytecode can be compiled further for the real microprocessor using what is called a just-in-time compiler.
The JVM must be implemented on a particular platform before compiled programs can run on that platform.

JVM

Q. 9 What is JDK?
Ans. JDK is a kit(or package) which includes two things i) Development Tools(to provide an environment to develop your java programs) and ii) JRE (to execute your java program).

JAVA JDK

Q.10 What is full form of IDE? Give example of 2 IDE.
Ans.
IDE stands for Integrated Development Environment. IDE for developing Java Application is Eclipse, NetBeans, JDeveloper, MyEclipse, BlueJ.

Q.11 What is BlueJ?
Ans. BlueJ is an integrated development environment (IDE) for the Java programming language, developed mainly for educational purposes, but also suitable for small-scale software development.

  • It has a built in editor
  • Interactive interface to create and test objects
  • Ability to run applications

Q.12 What is the difference between Applets and application?
Ans.

AppletsApplications
It is a portable language and can be executed by any JAVA supported browser.Its program coding is large as compared to applets.
It executed or runs a program on client browser.It can be executed on standalone computers.
The applets are created by using java.applet.Applet package.The applications are created by using method:
“public static void main(String args[ ])”

Q. 13 What are comments? What are different types of comments found in the program?
Ans.    

  • Comments are descriptions that are added to the program to make code easier to understand.
  • Compiler ignores the comments

TypeSyntaxUsage
Single-line// commentAll characters after the // up to the end of the line are ignored.
Multiline/* comment */All characters between /* and */ are ignored.
Documenting (Doc) Comment/** Comment */The JDK javadoc tool uses doc comments when preparing automatically generated documentation.

Q. 14 What are different types of errors you find in your program?
Ans.
Syntax errors:

  • Errors occurring when you violate a syntax rule.
  • Caught during compile time
  • E. g. forgetting to terminate program statement with ;

Logical errors:

  • Also called design errors or bugs which escape compilation
  • Occurs when logic of the program is incorrect.
  • Can be fixed by testing & debugging the program
  • E. g. PI = 31.4;

Run-time errors:

  • Occur when we ask the computer to do something it considers to be illegal.
  • In these cases Java throws exception
  • E. g. dividing by zero

Q. 15 What are Escape Sequences?
Ans. Escapes Sequences represents special control characters and characters that cannot be printed.

  • They are special type of character literal
  • Represented by a Backslash (\) followed by a character code

Escape SequenceDescription
\tInsert a tab in the text at this point.
\bInsert a backspace in the text at this point.
\nInsert a newline in the text at this point.
\rInsert a carriage return in the text at this point.
\fInsert a formfeed in the text at this point.
\’Insert a single quote character in the text at this point.
\”Insert a double quote character in the text at this point.
\\Insert a backslash character in the text at this point.

  • Share:
author avatar
Simply Coding

Previous post

Python Data Types
June 15, 2021

Next post

Learn Python if elif else
June 15, 2021

You may also like

Types of Programming Languages
Types of Programming Languages
16 June, 2021
Input-Output in Java
Input/Output in Java
17 January, 2021
Java print exam questions
Java print/println exam questions
7 June, 2020

Leave A Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Uncategorized
  • Programs
    • Python
    • Java
  • Problems
    • Python
    • Java
    • Web Development
      • Internet
    • Emerging Technologies
  • Notes
    • General
    • QBasic
    • MS Access
    • Web Development
      • XML
      • HTML
      • JavaScript
      • Internet
    • Database
    • Logo Programming
    • Scratch
    • Emerging Trends
      • Artificial Intelligence
      • Internet of Things
      • Cloud Computing
      • Machine Learning
    • Computer Fundamentals
      • Computer Networks
      • E-Services
      • Computer Hardware
    • Python
    • Java
  • School
    • ICSE
      • Computers Class 9
        • Java Introduction
        • Tokens & Data Types
        • Java Operators
        • Math Library
        • if & switch
        • For & While
        • Nested loops
      • Computer Class 10
        • Sample Papers
        • OOPS concepts
        • Functions in Java
        • Constructors
        • Arrays in Java
        • Strings in Java
    • SSC
      • IT Class 11
        • IT Basics
        • DBMS
        • Web Designing
        • Cyber Laws
      • IT Class 12
        • Web Designing
        • SEO
        • Advanced JavaScript
        • Emerging Tech
        • Server Side Scripting
        • E-Com & E-Gov
      • Computer Science 11
      • Computer Science 12
    • CBSE
      • Computer 9
        • Basics of IT
        • Cyber Safety
        • Scratch
        • Python
      • Computer 10
        • Sample Papers
        • Networking
        • HTML
        • Cyber Ethics
        • Scratch
        • Python
      • Computer Science 11
        • Computer Systems
        • Python 11
          • Python Basics
          • Python Tokens
          • Python Operators
          • Python if-else
          • Python loops
          • Python Strings
          • Python List
          • Python Tuple
          • Python Dictionary
          • Python Modules
        • Data Management
      • Computer Science 12
        • Sample Papers
        • Python 12
          • Python Functions
          • Python File Handling
          • Python Libraries
          • Python Recursion
          • Data Structures
        • Computer Networks
        • Data Management
    • ISC
      • Computer Science 11
        • Introduction to Java
        • Values & Data Types
        • Operators
        • if & switch
        • Iterative Statements
        • Functions
        • Arrays
        • String
        • Data Structures
        • Cyber Ethics
      • Computer Science 12
        • Sample Papers
        • Boolean Algebra
        • OOPS
        • Wrapper Classes
        • Functions
        • Arrays
        • String
Simply Coding Computer Courses for School                Privacy Policy     Terms of Use     Contact Us

© 2021 Simply Coding

Login with your site account

Lost your password?

Not a member yet? Register now

Register a new account

Are you a member? Login now