CS4001NI Week 1 Introduction to Java Programming PDF

Document Details

RejoicingMagic8285

Uploaded by RejoicingMagic8285

Islington College

null

null

Tags

java programming computer science programming languages introduction to programming

Summary

This document is an introduction to Java programming, outlining the course content for week 1, including course setup, assignment rules, assessment schedule, and course contents. It also covers language processors and the Java Development Kit (JDK).

Full Transcript

Week - 1 Lecture Introduction Course Setup 20 lectures Each lecture will be followed by a tutorial and a workshop. Weekly Assignment (MCQ + Independent Learning + Coursework)  100 Marks 2 Assignme...

Week - 1 Lecture Introduction Course Setup 20 lectures Each lecture will be followed by a tutorial and a workshop. Weekly Assignment (MCQ + Independent Learning + Coursework)  100 Marks 2 Assignment Rules Individual tutorials/coursework. Missed deadlines will be dealt very severely. We take plagiarism very seriously so exchange ideas not solutions. Any student found copying part of a program or have someone else do it for them( friends, colleagues, relatives or hired personnel) and unable to defend on VIVA will fail the assignment. 3 Assessment Schedule Assessment Method Description % Weighting Due Week In-Class MCQ Test Online multiple choice 30 12(Actual date will be test, 1.5 hours confirmed as part of the exam schedule) Independent Learning Independent study 10 24 from provided learning material along with technical report Coursework Coursework (online 60 28 submission), 1200 words + software Course Contents: Week Contents 1 course introduction, java introduction and installation 2 (terminologies) Comments, Identifiers, Keywords, Syntax and Semantics, Indentation Variables, Data type, Java Literals, Escape Sequence, Operator 3 control statement if and switch 4 looping 5 Array, 1D, 2D 6 Methods Constructor Formal and Actual parameters Scope of variables Course Contents: Week Contents 7 object and classes, Class/object relationship Primitive and object types access modifiers Abstraction, Modularization 8 1. Inheritance 2. method overloading, 3. method overriding 9 OOP (Encapsulation) CW distribution 10 OOP (Abstract class and Interface) 11,12 MCQ Revision 13,14,15 [semester break] Course Contents: Week Contents 16 String in Java 17 ArrayList 18 Basic GUI components frame, text fields, buttons, labels 19 Radio button, check box, text area lay out manager, menu bar Milestone-1 Coursework 20 Event handling 21 Exception handling 22 object casting 23, 24 23 -> File Handling Milestone-2 Coursework 24 -> Independent Learning 25, 26, 27 CW Orientation 28 Coursework Deadline week Core readings Objects First with Java (6th edition) Author: David J. Barnes, Michael Kolling Publisher: Pearson Education Limited 8 Practical tools 9 Language processor It is a software tool which is used to convert programs written in high level and assembly language into machine level language. 0101011111010100101 Language Processor High Level Language 10 Language processor: Types 1. Assembler 2. Compiler 3. Interpreter 11 Assembler An assembler is a language processor that converts programs written in assembly language into machine level language. 12 Compiler and interpreter These are the language processors that convert programs written in high level programming languages into machine level language. 13 Differences between Compiler and Interpreter Compiler checks and converts a whole program into machine level language all at once, While an interpreter checks and converts each line of code one-by-one Compiler and interpreter C, C++, Pascal, COBOL, FORTRAN BASIC, Python, Ruby, Perl 15 Which of the following does Java use? a. Compiler b. Interpreter c. Assembler d. Both a and b Correct: d) Both a and b QUIZ Which of the following is NOT a language processor used in programming? a. Assembler b. Compiler Correct: c. Interpreter d. Debugger d) Debugger 17 Features of Java Robust: -Java uses strong memory management. -There are lack of pointers that avoids security problem. -There is automatic garbage collection in java. -There is exception handling and type checking mechanism in java. Architecture-neutral: -There is no implementation dependent features e.g. size of primitive types is fixed. -In C programming, int data type occupies 2 bytes of memory for 32- bit architecture and 4 bytes of memory for 64-bit architecture. But in java, it occupies 4 bytes of memory for both 32 and 64 bit architectures. Portable: We may carry the java byte code to any platform. 18 Why Java? 19 Why Java? OOP Easy to learn Simple object-oriented programming language Tons of resources available to learn Java 20 Why Java? Open source and rich API (application programming Powerful development tools interface) tools are available available, e.g. Eclipse, Netbeans, Lots of job opportunities BlueJ 21 Applications of Java 1. Mobile applications and games 2. Desktop applications 3. Web applications 4. Scientific applications 5. Console applications Mobile games: Minecraft PE 22 Applications of Java 1. Mobile applications and games 2. Desktop applications 3. Web applications 4. Scientific applications 5. Console applications Desktop applications 23 Applications of Java 1. Mobile applications and games 2. Desktop applications 3. Web applications 4. Scientific applications 5. Console applications Web applications: E-commerce application platforms such as Broadleaf 24 Applications of Java 1. Mobile applications and games 2. Desktop applications 3. Web applications 4. Scientific applications 5. Console applications Scientific applications: MATLAB 25 Applications of Java 1. Mobile applications and games 2. Desktop applications 3. Web applications 4. Scientific applications 5. Console applications Console applications 26 Features of Java High-performance: Java is faster than traditional interpretation since byte code is "close" to native code still somewhat slower than a compiled language (e.g., C++) Distributed: We can create distributed applications in java. RMI and EJB are used for creating distributed applications. We may access files by calling the methods from any machine on the internet. Multi-threaded: -A thread is like a separate program, executing concurrently. -We can write Java programs that deal with many tasks at once by defining multiple threads. -The main advantage of multi-threading is that it doesn't occupy memory for each thread. It shares a common memory area. - Threads are important for multi-media, Web applications etc. 27 Text Editor and IDE IDE -> Integrated Development Environment A code editor, a complier, a debugger and a graphical user interface (GUI) builder. - Notepad - Notepad++ - BlueJ - Netbeans - Eclipse 28 JDK, JRE and JVM Tuesday, November 8, 2024 JDK, JRE and JVM JDK JRE JVM The full form of JDK is Java The full form of JRE is Java Runtime The full form of JVM is Java Virtual Development Kit. Environment. Machine. JDK is a software development kit to It is a software bundle which provides JVM executes Java byte code and develop applications in Java. Java class libraries with necessary provides an environment for executing it. components to run Java code. JDK is platform dependent. JRE is also platform dependent. JVM is platform-independent. It contains tools for developing, It contains class libraries and other Software development tools are not debugging, and monitoring java code. supporting files that JVM requires to included in JVM. execute the program. It is the superset of JRE It is the subset of JDK. JVM is a subset of JRE. The JDK enables developers to create The JRE is the part of Java that creates It is the Java platform component that Java programs that can be executed and the JVM. executes source code. run by the JRE and JVM. JDK comes with the installer. JRE only contain environment to execute JVM bundled in both software JDK and source code. JRE. 30 Tuesday, November 8, 2024 Structure of JAVA program package test // package declaration public class Hello{ public static void main (String [] args) // main method{ System.out.println(“Hello World”); //print out } } 31 Tuesday, November 8, 2024 JAVA Rule and Convention - Class name and the file name should have same name. - File name should be save in.java extension. (eg: Hello.java) - The system must have JDK installed. - Locate the C:\Program Files\Java\jdk1.7.0_07\bin in My Computer Properties  Advanced system settings  Environment Variables  New Variable Name : Path Variable Value : C:\Program Files\Java\jdk1.7.0_07\bin 32 Tuesday, November 8, 2024 Compile and Run Java program - Open console (command prompt). - Locate to Hello.java drive or its specific folder. - javac Hello.java - java Hello 33 Any Questions??

Use Quizgecko on...
Browser
Browser