CSA 1012 Object-Oriented Programming

Similar documents
How to use the Eclipse IDE for Java Application Development

Appendix A Using the Java Compiler

Java Software Development Kit (JDK 5.0 Update 14) Installation Step by Step Instructions

A Short Introduction to Writing Java Code. Zoltán Majó

Installing Java. Table of contents

Installing Java (Windows) and Writing your First Program

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Java CPD (I) Frans Coenen Department of Computer Science

Introduction to programming

Introduction to Java

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C

Chapter 1 Java Program Design and Development

How to Install Java onto your system

Java Programming Unit 1. Your first Java Program Eclipse IDE

Crash Course in Java

LAB4 Making Classes and Objects

Java applets. SwIG Jing He

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

Java Crash Course Part I

LAB 1. Familiarization of Rational Rose Environment And UML for small Java Application Development

CSE 452: Programming Languages. Acknowledgements. Contents. Java and its Evolution

Introduction to Object-Oriented Programming

Chapter 1 Fundamentals of Java Programming

Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.

Java Programming Fundamentals

Introduction to Java Applications Pearson Education, Inc. All rights reserved.

An Overview of Java. overview-1

WHAT ARE PACKAGES? A package is a collection of related classes. This is similar to the notion that a class is a collection of related methods.

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Contents. Java - An Introduction. Java Milestones. Java and its Evolution

Mobile application development J2ME U N I T I I

Right now, the latest and greatest version of Java available for download is Start with this link to find out more about it

Creating a Java application using Perfect Developer and the Java Develo...

INTRODUCTION TO JAVA PROGRAMMING LANGUAGE

How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For

CS 106 Introduction to Computer Science I

qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq

1001ICT Introduction To Programming Lecture Notes

Java Interview Questions and Answers

The Java Virtual Machine and Mobile Devices. John Buford, Ph.D. Oct 2003 Presented to Gordon College CS 311

Tutorial: Getting Started

CS 209 Programming in Java #1

Introduction to Object-Oriented Programming

Supplement I.C. Creating, Compiling and Running Java Programs from the Command Window

Object-Oriented Programming in Java

CSC 551: Web Programming. Spring 2004

Demo: Controlling.NET Windows Forms from a Java Application. Version 7.3

Programming Languages

Syllabus for CS 134 Java Programming

6.1. Example: A Tip Calculator 6-1

Fundamentals of Java Programming

Java Language Tools COPYRIGHTED MATERIAL. Part 1. In this part...

Java Programming. Binnur Kurt Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0.

Characteristics of Java (Optional) Y. Daniel Liang Supplement for Introduction to Java Programming

WA2099 Introduction to Java using RAD 8.0 EVALUATION ONLY. Student Labs. Web Age Solutions Inc.

1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

Lab 1A. Create a simple Java application using JBuilder. Part 1: make the simplest Java application Hello World 1. Start Jbuilder. 2.

Chapter 5 Aspect Oriented Programming

INTRODUCTION TO OBJECTIVE-C CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 12 09/29/2011

JAVA - OBJECT & CLASSES

Java is an Object-Oriented Language. As a language that has the Object Oriented feature, Java supports the following fundamental concepts:

I. INTRODUCTION. International Journal of Computer Science Trends and Technology (IJCST) Volume 3 Issue 2, Mar-Apr 2015

What is Java? Applications and Applets: Result of Sun s efforts to remedy bad software engineering practices

CS506 Web Design and Development Solved Online Quiz No. 01

Java from a C perspective. Plan

Java with Eclipse: Setup & Getting Started

CS1020 Data Structures and Algorithms I Lecture Note #1. Introduction to Java

Eclipse installation, configuration and operation

Moving from CS 61A Scheme to CS 61B Java

Konzepte objektorientierter Programmierung

What Perl Programmers Should Know About Java

Mobile Application Languages XML, Java, J2ME and JavaCard Lesson 04 Java

More on Objects and Classes

Lesson 06: Basics of Software Development (W02D2

Programmierpraktikum

CMPT 183 Foundations of Computer Science I

SE 450 Object-Oriented Software Development. Requirements. Topics. Textbooks. Prerequisite: CSC 416

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Manual For Using the NetBeans IDE

D06 PROGRAMMING with JAVA. Ch3 Implementing Classes

For Introduction to Java Programming, 5E By Y. Daniel Liang

A Thread Monitoring System for Multithreaded Java Programs

Preet raj Core Java and Databases CS4PR. Time Allotted: 3 Hours. Final Exam: Total Possible Points 75

Masters programmes in Computer Science and Information Systems. Object-Oriented Design and Programming. Sample module entry test xxth December 2013

How To Create A C++ Web Service

Division of Informatics, University of Edinburgh

public static void main(string[] args) { System.out.println("hello, world"); } }

Mobile Application Development Android

Programmation 2. Introduction à la programmation Java

Tutorial 0A Programming on the command line

Lecture J - Exceptions

Chapter 12 Programming Concepts and Languages

Application Servers - BEA WebLogic. Installing the Application Server

02 B The Java Virtual Machine

Install Java Development Kit (JDK) 1.8

Java Classes. GEEN163 Introduction to Computer Programming

File class in Java. Scanner reminder. Files 10/19/2012. File Input and Output (Savitch, Chapter 10)

Course Title: Software Development

Transcription:

CSA 1012 Object-Oriented Programming Mr. Joseph Cordina Rm 203, New Comp. Bldg. E-mail: joseph.cordina@um.edu.mt 1

Course Objectives Familiarity with the syntax of the Java or C# language Programming in an object oriented style Building structured, reusable, manageable platform independent stable code Course Structure: Basic Java/C# syntax OOP OOP using Java/C# 2

Introduction 2 Hour lecture will be given every week You are assumed to know previous lecture by the next lecture. Practicing at home will be necessary since organised practical sessions will be difficult to organise. Course Notes will be supplied and are available at: www.cs.um.edu.mt/~jcord Practical assignment will make part of the credit together with a written test. Take your own notes in the lecture hall as they will be essential. 3

Requirements Recommended Textbooks: Java: How to Program; Deitel and Deitel; ISBN 0-13-012507-5 C#:How To Program; Deitel and Deitel; ISBN 0-13-06222104 Object-Oriented Analysis and Design with Applications; Grady Booch; ISBN 0-8053- 5340-2 Java Compiler and Documentation: Available at http://java.sun.com as Java 2 SDK 1.3 or 1.4 (J2SE) Docs at http://java.sun.com/j2se/1.4.1/docs/api/index.html Remember to add the bin directory to your path (in autoexec.bat for Windows) Command prompt programming is recommended ( command or cmd ) Yet you can use any IDE such as JBuilder and Forte C# Compiler and Documentation Csc.exe is a free C# compiler; alternative Visual Studio.net Docs at http://msdn.microsoft.com/library/default.asp?url= /library/en-us/cpref/html/cpref_start.asp 4

Why Java/C#? Java/C# is just another programming language but has several special feature: Simple making it easy to learn and use Reliable and Robust Some of its features are formally proven Has many built in features such as memory management and garbage collection Most features are tested at run-time. Platform independent Never compiles to machine code but to byte-code/msil Any platform using JVM/.Net (CLR) can run this byte code Distributed Secure Interpreted making development easier Multi-threaded Dynamic making changes on the fly possible Object Oriented 5

Why Object Oriented? Object Oriented Programming is an approach towards programming where we take a more natural view of the problem domain as compared to procedural programming. Main Features of OOP are: Abstraction Encapsulation Modularity Hierarchy Java/C# can still be used as a non- OOP language but it acts as an aid towards OOP. A more strict language is SmallTalk and a less strict language is C++. 6

Your First Program in Java Type the following using the edit command or notepad import java.io.*; public class HelloWorld { public static void main (String [] args) { System.out.println ( Hello World! ); Save as HelloWorld.java Invoke Compiler : javac HelloWorld.java Invoke JVM : java HelloWorld Should see Hello World! printed to screen. See that CLASSPATH is not set or set to current directory. doskey comes in handy. 7

Your First Program in C# using System; class Welcome1 { static void Main (String[] args) { Console.WriteLine ( Hello World! ); Compile using appropriate buttons, and then execute. 8

Sample Output 9

Template for Programs The following template should be used until we cover what each keyword means. import java.io.*; public class ClassName { public static void main(string args[]) { // your programming code using System; class ClassName { static void Main(String args[]) { // your programming code ClassName can be changed to whatever you wish but always save your program in a file ClassName.java Java/C# Is Case Sensitive After compiling, a byte/msil file called ClassName.class/Filename.exe is created. 10

Exercises Try to compile the HelloWorld program. Create programs under a different classname. Make your program print out your name. Make your program print out 3 copies of your name under each other. 11