-
Notifications
You must be signed in to change notification settings - Fork 0
/
discussions-page.html
88 lines (80 loc) · 4.27 KB
/
discussions-page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="discussions-page.css">
<title>Questions About Python and Java</title>
</head>
<body>
<div id="navbar"></div>
<div class="body-main">
<div class="disc-container">
<h1 class="disc-title">Frequently Asked Questions About Python and Java</h1>
<button class="ask-button" onclick="askQuestion()">Ask a Question</button>
<div class="question">
<h2 class="qn">1. What is Python?</h2>
<p class="ans">Python is a high-level, interpreted programming language known for its readability and simplicity.</p>
</div>
<div class="question">
<h2 class="qn">2. What is Java?</h2>
<p class="ans">Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible.</p>
</div>
<div class="question">
<h2 class="qn">3. What are the key features of Python?</h2>
<p class="ans">Key features of Python include its simplicity, extensive libraries, and dynamic typing.</p>
</div>
<div class="question">
<h2 class="qn">4. What are the key features of Java?</h2>
<p class="ans">Java is known for its platform independence, strong memory management, and rich standard libraries.</p>
</div>
<div class="question">
<h2 class="qn">5. Is Python statically typed or dynamically typed?</h2>
<p class="ans">Python is dynamically typed, meaning variable types are determined at runtime.</p>
</div>
<div class="question">
<h2 class="qn">6. Is Java statically typed or dynamically typed?</h2>
<p class="ans">Java is statically typed, meaning variable types must be declared at compile-time.</p>
</div>
<div class="question">
<h2 class="qn">7. What are Python's main applications?</h2>
<p class="ans">Python is widely used in web development, data analysis, artificial intelligence, scientific computing, and automation.</p>
</div>
<div class="question">
<h2 class="qn">8. What are Java's main applications?</h2>
<p class="ans">Java is commonly used in web development, enterprise applications, mobile applications (Android), and cloud-based services.</p>
</div>
<div class="question">
<h2 class="qn">9. How does Python handle memory management?</h2>
<p class="ans">Python uses automatic memory management through reference counting and a built-in garbage collector.</p>
</div>
<div class="question">
<h2 class="qn">10. How does Java handle memory management?</h2>
<p class="ans">Java manages memory through an automatic garbage collection process, which removes unused objects from memory.</p>
</div>
</div>
</div>
<div id="footer"></div>
<script>
// JavaScript to load the navbar
fetch("navbar.html")
.then(response => response.text())
.then(data => {
document.getElementById("navbar").innerHTML = data;
// Change navbar color based on the page after navbar is loaded
const currentPage = window.location.pathname; // Current page path
if (currentPage.includes("discussions-page.html") || currentPage.includes("/discussions-page")) {
document.getElementById("navbar").style.backgroundColor = "#1e3a6e"; // Different color for Page 2
}
})
.catch(error => console.error('Error loading navbar:', error)); // Error handling
// Load the footer
fetch("footer.html")
.then(response => response.text())
.then(data => {
document.getElementById("footer").innerHTML = data;
})
.catch(error => console.error('Error loading footer:', error)); // Error handling
</script>
</body>
</html>