Lecture 1 PDF
Lecture 1 PDF
Reference Books:
• Java How to Program 9th Edition
• By Deitel and Deitel
Schoology link
▪ https://app.schoology.com/course
/1533081529/materials
• Non-structured Programming
• Function/Structured Programming
• Object Oriented Programming
Programming Paradigm-Introduction
• object-oriented programming, which you can use to develop GUI and large-
scale software systems.
• We can create object by using class. So first we will create class and
then we will create object.
Using C++ to create
class and its
corresponding object
Class Syntax
class ClassName
{
…
DataType MemberVariable;
ReturnType MemberFunction();
…
};
Example
class Student
{
int rollNo;
char name;
float CGPA; Member variables
char address;
Member Functions
…
void setName(char newName);
void setRollNo(int newRollNo);
…
};
Declaring class variables
• Variables of classes (objects) are declared just like variables of built-in data types
TypeName VaraibaleName;
int var;
Accessing members
Student aStudent;
aStudent.setRollNo(5);
#include <iostream>
using namespace std;
class smallobj //define a class
{
private:
int somedata; //class data
public:
• Assembly Language:
C++ Java
Explicit memory management and pointers. Managed memory access. In Java memory is
C++ applications can have memory leaks. managed for us. JVM automatically de-
allocates the memory for us.
Multiple inheritance Limited to single inheritance
30
The Java Language Specification, API, JDK, and IDE
32
33
Installing JDK
• In the folder where you've downloaded the JDK, right-click on the jdk-
8u51- windows-x64.exe file and select Run as administrator.
34
35
36
37
38
39
Click
Setting up the path for windows: