0% found this document useful (0 votes)
26 views7 pages

Oop Group Assignment - 120021

The document outlines a group assignment for an Introduction to Object Oriented Programming course, detailing the relationship between Java and C, and explaining why Java is considered a general-purpose programming language. Key points include Java's platform independence, security features, extensive libraries, and automatic memory management. Additionally, it emphasizes Java's versatility, object-oriented structure, robustness, and scalability for various applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views7 pages

Oop Group Assignment - 120021

The document outlines a group assignment for an Introduction to Object Oriented Programming course, detailing the relationship between Java and C, and explaining why Java is considered a general-purpose programming language. Key points include Java's platform independence, security features, extensive libraries, and automatic memory management. Additionally, it emphasizes Java's versatility, object-oriented structure, robustness, and scalability for various applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

GROUP ASSIGNMENT

PROGRAMME : ODCS

MODULE CODE : ITT 06214

MODULE NAME : INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

FACILITATOR’S NAME :MBISE (Mr. kaanael)

ACADEMIC YEAR :2023/2024

NO STUDENT’S NAME REGISTRATION SIGNATURE


NUMBER

01. ELIA CHRISTOPHER HOKOLOLO ODCS-01-0037-2023

02. JASTINE M RICHARD ODCS-01-0041-2023

03. AHMAD IBRAHIM MUHAMAD ODCS-01-0028-2023

04.. LUTENGAMASO THOMAS SAMON ODCS-01-0046-2023


QUESTION ONE

(a) The history of java programming language is a story of innovation and adaptation, evolving
from a project aimed at consumer electronics to becoming a cornerstone of modern software
development. However, it is accurate to say that java’s design was significantly influenced by C
and also C++. Discuss the relationship between C and Java.

The relationship between the C programming language and Java is foundational, as Java was
designed with significant inspiration from C, sharing its syntax and various programming
paradigms while aiming to improve upon areas where C fell short. Here are key aspects of their
relationship:

➢ Platform Independence:
One of Java's primary goals was to achieve platform independence via its "write once,
run anywhere" philosophy. WHILE C is compiled to machine code for specific
platforms, Java code is compiled into bytecode that runs on the Java Virtual Machine
(JVM). This approach allows Java applications to run on any platform that has a
compatible JVM, a significant advancement over C's native execution model.
➢ Security Features:
Java places a strong emphasis on security, particularly with its use of the Java Virtual
Machine (JVM). The sandbox model allows for running applications in a controlled
environment, which can restrict capabilities like file access and network
communications. WHILE C does not inherently include such security measures, Java's
design reflects the changing landscape of software development, where security is a
critical concern.
➢ Standard Libraries:
Java comes with an extensive standard library (Java API) that provides built-in classes
and methods for a wide range of functionalities, promoting rapid development and
reducing the need for third-party libraries. WHILE C has standard libraries, they are
generally less extensive and often require additional libraries for object-oriented
functionalities.
➢ Memory Management:
C requires manual memory management through pointers and allocation functions (like
`malloc` and `free`), which can lead to complex bugs such as memory leaks and pointer
errors. Java, on the other hand, introduced automatic garbage collection to simplify
memory management and reduce the likelihood of such bugs. This design choice was
influenced by the recognition of these complexities in C.

Conclusion:

In summary, Java can be seen as a refinement and evolution of the ideas present in C,
incorporating the strengths of C while addressing its weaknesses. The influence of C and C++ is
significant, particularly in terms of syntax and the inclusion of OOP concepts. Java's design
choices reflect the needs of modern software development, emphasizing safety, portability, and
ease of use, resulting in its widespread adoption for a variety of applications, from web
development to enterprise software.

(b) Explain why java is considered a general-purpose programming language.

Java is considered a general-purpose programming language for several reasons:

➢ Versatility.

Java can be used to develop a wide range of applications, from web applications and
mobile apps to large-scale enterprise systems, embedded systems, and scientific
applications. Its flexibility allows developers to work in numerous domains and
industries.

➢ Platform Independence.

One of Java's core principles is the "write once, run anywhere" (WORA) philosophy.
Java programs are compiled into bytecode, which can be executed on any platform that
has a Java Virtual Machine (JVM). This platform independence makes it suitable for a
variety of operating systems, such as Windows, macOS, and Linux.
➢ Object-Oriented Structure

Java’s object-oriented programming (OOP) paradigm encourages modularity and code


reuse, making it easier to manage and maintain large codebases. This also allows
developers to model complex systems more intuitively.

➢ Robustness and Security

Java includes several features that enhance its robustness and security, such as strong
type checking, automatic garbage collection, and exception handling. This makes it
suitable for developing reliable applications in various environments.

➢ Scalability

Java is designed to build scalable applications that can handle increased loads efficiently.
Its concurrency features and performance optimizations make it an ideal choice for
enterprise-level solutions.

QUESTION TWO

Use Table 1 which shows numerical score ranges and their respective grades to write a Java
application that checks the student’s score and prints the student’s grade in a web browser.
Answer
II Handle invalid input
system.out.println("Invalid input. Please enter a valid integer score.");
} finally {
II Close the scanner to avoid memory Leaks
scanner.close();
}
}
}
REFERENCES

Binstock, Andrew (May 20, 2015). "Java's 20 Years of Innovation". Forbes. Archived from the
original on March 14, 2016. Retrieved March 18, 2016.

Barbara Liskov with John Guttag (2000). Program Development in Java – Abstraction,
Specification, and Object-Oriented Design. USA, Addison Wesley. ISBN 978-0-201-65768-5.

Chaudhary, Harry H. (July 28, 2014). "Cracking The Java Programming Interview: 2000+ Java
Interview Que/Ans". Archived from the original on September 29, 2023. Retrieved May 29,
2016.

Java 5.0 added several new language features (the enhanced for loop, autoboxing, varargs and
annotations), after they were introduced in the similar (and competing) C# language. Archived
March 19, 2011, at the Wayback Machine Archived January 7, 2006, at the Wayback Machine

You might also like