Short Questions. Instructor: Created by: Visit: 2/2/2018 OOP with JAVA. Muhammad Naveed

Similar documents
Object Oriented Programming with JAVA

JVM interprets the Java bytecode, controls how it interacts with the operating system and manages memory.

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

1. Introduction. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

CHAPTER 1. Introduction to JAVA Programming

Java Puzzle Ball Nick Ristuccia

Chapter 1 Introduction to Computers, Programs, and Java

Java Programming Language Mr.Rungrote Phonkam

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

II. Compiling and launching from Command-Line, IDE A simple JAVA program

Eng. Mohammed S. Abdualal

Getting Started with Java. Atul Prakash

CSE 421 Course Overview and Introduction to Java

Introduction to Java Programming

Fundamentals of Programming. By Budditha Hettige

Certified Core Java Developer VS-1036

Getting Started With Java

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Chapter 1 Introduction to Java

Installation guide for Java. Step by Step Guide. A C A D G I L D Page 1

Introduction to Java and OOP. Hendrik Speleers

CS260 Intro to Java & Android 02.Java Technology

Introduction to Programming (Java) 2/12

2 Introduction to Java. Introduction to Programming 1 1

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

Core JAVA Training Syllabus FEE: RS. 8000/-

Java Training JAVA. Introduction of Java

Networks Programming Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000)

Introduction to Java. Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.

Programming with Java

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

Java is a high-level programming language originally developed by Sun Microsystems and released in Java runs on a variety of

An Introduction to Software Engineering. David Greenstein Monta Vista High School

How to Install (then Test) the NetBeans Bundle

Chapter 1. Introduction

Chapter 1 Introduction to Computers, Programs, and Java

History Introduction to Java Characteristics of Java Data types

What s NetBeans? Like Eclipse:

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Object-Oriented Programming in Java

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

CompSci 125 Lecture 02

Component Based Software Engineering

Introduction to OOP Using Java Pearson Education, Inc. All rights reserved.

Object Oriented Concepts and Programming (CSC244) By Dr. Tabbasum Naz

This lecture will take you through simple and practical approach while learning Java Programming language.

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Introduction to IntelliJ

02/03/15. Compile, execute, debugging THE ECLIPSE PLATFORM. Blanks'distribu.on' Ques+ons'with'no'answer' 10" 9" 8" No."of"students"vs."no.

History of Java. Java was originally developed by Sun Microsystems star:ng in This language was ini:ally called Oak Renamed Java in 1995

Java Programming. Manuel Oriol, March 22nd, 2007

3. Hello World! for IDEA. Java. Summer 2008 Instructor: Dr. Masoud Yaghini

Introduction to JAVA Programming Language

Before you start with this tutorial, you need to know basic Java programming.

Chapter 1 Introduction to Computers, Programs, and Java

For live Java EE training, please see training courses at

Lecture 1: Introduction to Java

Mobile Computing LECTURE # 2

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Javac and Eclipse tutorial

Java Professional Certificate Day 1- Bridge Session

IQTIDAR ALI Lecturer IBMS Agriculture University Peshawar

AP Computer Science A: Java Programming

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

Chapter 1 Introduction to Java

C O M P U T A T I O N A L P H Y S I C S

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Setting up your Computer

Computing Science 114 Solutions to Midterm Examination Tuesday October 19, In Questions 1 20, Circle EXACTLY ONE choice as the best answer

Introduction to Java

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

C++ Spring Break Packet 11 The Java Programming Language

JDB - QUICK GUIDE JDB - INTRODUCTION

Chapter 1 Introduction to Computers, Programs, and Java

CHAPTER 1: A GENERAL INTRODUCTION TO PROGRAMMING 1

Advanced Object-Oriented Programming Introduction to OOP and Java

COMP6700/2140 JDK Tools

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Getting Started with Eclipse/Java

Running Java Programs

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

Chapter 1 Introduction to Computers, Programs, and Java

Lesson 01 Introduction

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Class List. Java Must Have. Class Goals. Class Goals. Schedule

Sir Muhammad Naveed. Arslan Ahmed Shaad ( ) Muhammad Bilal ( )

Chapter 1: Introduction to Computers, Programs, and Java

Introduction. Overview of the Course on Java. Overview of Part 1 of the Course

Module 1: Introduction to Computers, Programs, and Java

Objects and Classes Lecture 1

JAVA: A Primer. By: Amrita Rajagopal

Setup and Getting Startedt Customized Java EE Training:

CS5015 Object-oriented Software Development. Lecture: Overview of Java Platform. A. O Riordan, 2010 Most recent revision, 2014 updated for Java 8

Notes of the course - Advanced Programming. Barbara Russo

Introduction to Java Programming CPIT 202. WEWwwbvxnvbxmnhsgfkdjfcn

Programming Language Basics

Lecture 1: Overview of Java

CISC 370: Introduction to Java

Transcription:

2/2/2018 OOP with JAVA Short Questions Instructor: Muhammad Naveed Created by: Muhammad Bilal & Arslan Ahmad Visit: www.techo786.wordpress.com/daenotes/

Chapter No 01 Introduction to Java Short Questions Q1: What is OPP(Object oriented programming)? OPP (object oriented programming) is a programming style that is associated with the concept of classes,objects and various other concepts revolving around these two. Q2: When was Java introduced? The JAVA was developed by Sun Microsystems in 1991 and named as OAK.It was named as JAVA in 1995.The first stable version, JDK 1.0.2, is called Java 1.The latest version of java at this time is JAVA SE 8. Q3: Who made Java? Java was developed by Sun Microsystems in 1991.Java was created by James Gosling who was a best Canadian computer scientist.according to the Sun Microsystems,three billion devices are using Java. Q4: What do you know about the security of Java? Java is a powerfull general-purpose programming language environment.it is one of the most used programming language in the world.java is robust,secured and object oriented programming language.it is gurranted to write once run anywhere (WORA).

Q5: What is JVM(Java Virtual Machine)? The JVM (java virtual machine) is a program that provides the runtime environment necessary for Java progams to execute.jvm is a machine within a machine.java programs cannot run unless there is a JVM available for the appropriate operating system platform we wish to execute. Syntax: java<arguments><program name> Q6: What are program execution phases? There are there phases for a program execution: 1. Writing a Program.(A programmer write a code to make a program) 2. Compilation of Program.{This is done by javac (java compiler) } 3. Running the Program. Q7: What is Byte Code? A halfway house between source code and object code is called byte code. Byte code is a format that can be executed efficiently by the JVM s interpreter. Q8: What is JRE (Java Runtime Environment)? JRE is used to provide a java runtime environment at runtime.it contains set of libraries(.h) in combination with core classes and various other files that are used by JVM at runtime.jre is a part of JDK (Java Development Kit). Q9: State components of JRE? Java webstart and plugin. User interface kit (AWT,Swing,Image input/output). JRE includes JDBC (Java Database Conectivity). IDL (Interface Development Language) and JNDL (Java Naming Development Interface) and RMI (Remote Method Invocation). Q10: What is JDK (Java Development Kit)? JDK contains everything that is required to compile and run a java program.jdk is a software kit in java,when you download JDK,JRE is also downloaded.in addition to JRE,JDK contains number of development tools (compilers,debuggers,javadoc etc). Q11: What is IDE (Intregrated Develpoment Environment)?

An IDE (intregrared development environment) is a software suit that consolidates the basic tools developers need to write and test software. Q12: How to create a new project in Netbeans (IDE)? 1. File -> New project. 2. Then select Java under category 3. Select java application under project and click next. 4. Enter a project name. 5. Select project location and check create main class then click finish. Q13: How to add Class or Package in java program? 1. File -> Newfile. 2. Select java under category. 3. Select java class under file type and click next. 4. Type name for class or package. 5. In case for class,select the desired package also and click finish. Q14: How to build a project in java? 1. In netbeans IDE,after writing code click the hammer icon to build the project. 2. Click the green arrow or press F6 to run the project. 3. Output should be at the bottom of screen. Q15: What is the structure of a java program? The structure of java program contains: 1. Package 2..Class 3. Classname 4. Data members 5. Methods 6. Comments Q16: What is package? A package is a collection of classes,interfaces and sub-programs. e.g Java.lang.*;

This package is imported by default. Q17: What is.class?.class is a keyword used for developing user defined data type and every java program must start with the concept of class. Q18: Define classname? Classname represent a valid java variable name treated as the name of class.each and every classname in java is a user defined data type. Q19: What are data members? Data members are variables declared inside a class.data members maybe private or public. Q20: Define methods? The function declared inside a class are called member functions.these are also called methods and user defined functions. Q21: What are comments? Comments are the statements that are not executed by compiler or interpreter.comments are used to provide information or explaination about the variable,method,class or any other statements.it can be used to hide the program code temporarily. Q22: Define single line comment? These are used to comment only single line a time. For Example: //sum is use to add; Q23: Define multiline comment? These are used to comment multilines at a time. For Example: //subtract is use to minus //this a calculator code

Q24: Define documentation? These type of comments are used to provide information about the code to the programmer. For Example: /** Coded by M Bilal Start date 12/08/17 End date 25/08/17 */ Chapter No 01 Ended Thanks for visiting our site www.vbforstudent.tk Checkout our blog: www.techo786.wordpress.com

LONG QUESTIONS Explain Java Program Structure Every Java program consists of a collection of classes--nothing else. A class is a template for creating a particular form of object. Each object created by the template contains the same members, each of which is either a field or a method. A field is a ``container'' that holds a value. A method is an operation on the fields of the object and any values that are passed as arguments to the method. The objects created by a particular class template are called the instances or objects of that class. Each instance contains the members specified in the class template. Structure of java program: Java program involves following sections Documentation Section

Package Statement Import Statements Interface Statement Class Definition Main Method Class Main method definition Explain life cycle of java program Life cycle of a Java program. There are three main stages in the life cycle of a java program. They are: Editing the program

Compiling the source code Executing the byte code In the first step we will edit the program and save it with.java extension Second step is compilation. The name of the Java compiler is javac. The input to the compiler is Java source code. The output of the compiler is machine independent or platform independent code, which is known as bytecode. The file, which is generated after compilation, is.class file. Last step is execution. Java Virtual Machine (JVM) will execute the bytecode generated by the compiler. Input to the JVM is bytecode and output is machine code (0 s and 1 s) which will be executed by the CPU of the local machine. Setup environment variable Step 1: Right Click on My Computer and click on properties. Step 2: Click on Advanced tab Step 3: Click on Environment Variables Step 4: Create a new class path for JAVA_HOME Step 5: Enter the Variable name as JAVA_HOME and the value to your jdk bin path ie ;c:\programfiles\java\jdk-1.6\bin and Step 6: Follow the Above step and edit the Path in System Variables add the following; ;c:\programfiles\java\jdk- 1.6\bin:\Programfiles\Java\jdk-1.6\bin in the value column. Step 7: You are done setting up your environment variables for your Java Instal NetBeans

STEP 1: INSTALL JDK To use NetBeans for Java programming, you need to first install Java Development Kit (JDK). STEP 2: DOWNLOAD Download "NetBeans IDE" from http://netbeans.org/downloads/index.html. There are many "bundles" available. For beginners, choose the 1st entry "Java SE" (e.g., "netbeans-8.2-javase-windows.exe" 95MB). STEP 3: RUN THE INSTALLER Run the downloaded installer. Integrated Development Environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, build automation tools, and a debugger. The mostly used IDE for coding in java are Eclipse and NetBeans. Java Virtual Machine JVM is an abstract machine. It is a specification that provides runtime environment in which java byte code can be executed. JVM are available for many hardware and software platform. JVM perform following operations Load code Verifies code Execute code Java Runtime Enviroment

Java runtime environment (JRE) is a set of software tools for development of java application. It combines the java virtual machine platform, core classes and supporting libraries. JRE is a part of the java development kit but can be download separately. Java Development Kit JDK is a software development environment used for developing java applications and applets. It includes the java runtime environment, an interpreter/loader, compiler, an archiver, a documentation generator (Javadoc) and other tools needed in java development. Byte Code Byte code is computer object code that is processed by a program usually referred to as virtual machine rather than by the real computer hardware processor. The best-known language that use the byte code and virtual machine approach is java.