0% found this document useful (0 votes)
8 views4 pages

Internet - Prograabsjisj JB Mming - Answers

The document provides an overview of key concepts in Internet programming, JVM, OOP, packages, threads, applets vs applications, cryptography, encryption, and synchronization in Java. It outlines features and components of each topic, along with example code snippets for practical understanding. The information serves as a foundational guide for software development and programming principles.

Uploaded by

babalegacy83
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)
8 views4 pages

Internet - Prograabsjisj JB Mming - Answers

The document provides an overview of key concepts in Internet programming, JVM, OOP, packages, threads, applets vs applications, cryptography, encryption, and synchronization in Java. It outlines features and components of each topic, along with example code snippets for practical understanding. The information serves as a foundational guide for software development and programming principles.

Uploaded by

babalegacy83
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/ 4

1. What do you mean by Internet programming? Explain its features.

Internet Programming involves creating software applications that run on the internet.

Features include:

- Platform Independence

- Web-based Interface

- Supports Networking Protocols (HTTP, FTP)

- Secure Communication (SSL/HTTPS)

- Client-Server Architecture

2. What is JVM? Discuss about its components briefly.

JVM (Java Virtual Machine) is part of the JRE that executes Java bytecode.

Components:

- Class Loader: Loads class files

- Bytecode Verifier: Ensures code safety

- Interpreter: Executes bytecode line by line

- JIT Compiler: Converts bytecode to machine code

- Garbage Collector: Manages memory automatically

3. What do you mean by class & object? Explain features of OOP.

Class: Blueprint for creating objects.

Object: Instance of a class.

OOP Features:

- Encapsulation

- Abstraction

- Inheritance

- Polymorphism

- Modularity

4. What do you mean by package? How does it help? How to define a package in Java?
Package is a namespace that organizes classes and interfaces.

Helps by:

- Avoiding name conflicts

- Code reusability

- Better organization

Defining a package:

```java

package mypackage;

public class MyClass {}

```

5. What is Thread? Write a program to achieve multithreading in Java.

Thread is a lightweight sub-process used for multitasking.

Example program:

```java

class MyThread extends Thread {

public void run() {

for(int i=0; i<5; i++) System.out.println(i);

public static void main(String args[]) {

MyThread t = new MyThread();

t.start();

```

6. Explain differences between Applet and Application.

| Feature | Applet | Application |


|--------------|-------------------|------------------------|

| Execution | In browser | Standalone |

| Main Method | Not required | Required |

| GUI Support | AWT | AWT/Swing/Console |

| Security | Restricted | Full system access |

7. What is cryptography? Define its functions.

Cryptography secures data by encoding it.

Functions:

- Confidentiality

- Integrity

- Authentication

- Non-repudiation

8. Define encryption. What is public key algorithm?

Encryption converts data into unreadable format.

Public Key Algorithm uses:

- Public Key: for encryption

- Private Key: for decryption

Example: RSA

9. Explain synchronization. Write a program to achieve it in Java.

Synchronization controls thread access to shared resources.

Example:

```java

class Table {

synchronized void print(int n) {

for(int i=1; i<=5; i++) System.out.println(n*i);

}
}

class MyThread extends Thread {

Table t;

MyThread(Table t) { this.t = t; }

public void run() { t.print(5); }

public class TestSync {

public static void main(String[] args) {

Table obj = new Table();

new MyThread(obj).start();

```

You might also like