Your Unofficial Survival Guide to Java (CMP 175)

Alright, so you're up for the BCSIT Java course. Forget the formal syllabus-speak for a minute. This is a 3-credit, 48-hour course that's basically your boot camp for learning how to think in Objects.

It's offered in your first year(second semester )at Pokhara University, and it’s where you move from basic scripts to building actual software.

The whole point is to get you comfortable with Object-Oriented Programming (OOP) and Java. It's half theory, half getting your hands dirty with code. You will build things. Some will break. You'll learn to fix them.

Here's the lowdown on what you're facing, unit by unit:


java syllabus chapter1

Unit 1: Why Bother with OOP? (3 hrs)

Questions you MUST be able to answer:

The Gist: You will learn why programming had to be developed. The old-school procedural code gets dirty fast. OOP "Items" — is a way to organize chaos by creating small bundles of data and the functions they use. This is where they hit you with four big ideas: encapsulation (looking at your dirty details), inheritance (not repeating itself), polymorphism (one thing, many forms), and abstraction (the basis of the code "required for knowledge"):

What are the big four concepts of OOP?

  • What are the big four concepts of OOP? Explain them like I'm five.
  • what was wrong with the old way of programming?
  • What’s the actual difference between a class and an object? Give a simple analogy.
  • In your own words, what was wrong with the old way of programming?
  • What is the real difference between a class and an object? Give simple analogy.

  • Unit 2: Hello, Java (3 hrs)

The Gist: Meet Java. It runs everywhere for a clean trick called Java Virtual Machine (JVM), which serves as a universal translator for your code. This unit is about the basics: its main features (such as how it cleans its own disturbances with garbage collection) and unnecessary rules, such as naming conferences. Seriously, learn naming conferences. Your future self thanks you.

Questions you MUST be able to answer:

  • What's the deal with the JVM? Why does it make Java special?
  • Name three key features of Java.
  • How should you name your classes and variables? Why does it even matter?
  • Just write a "Hello, World!" program. No excuses.

Unit 3: Actually Using OOP in Java (3 hrs)

The Gist: Time for the rubber to meet the road. You’ll take the theories from Unit 1 and write them in Java. You’ll define classes (the blueprint), create objects (the actual thing), and control who gets to see what with public and private. This is also where you’ll learn about constructors (the special methods that give birth to objects) and the this keyword, which is just an object's way of talking about itself.

Questions you MUST be able to answer:

  • Show me how to make a simple class in Java.
  • What's encapsulation in Java? How do you actually do it with code?
  • What's a constructor? Is it just a weird-looking method?
  • What’s the point of the this keyword?

Unit 4: Inheritance & Polymorphism (The Brain-Melters) (6 hrs)

The Gist: These two sound complicated, but they’re just smart ways to be lazy. Inheritance is like a family tree for your code; subclasses get all the goodies from their superclasses. Polymorphism is like a shapeshifter—it lets you treat different objects in the same way. This is done with method overriding (a child class does something its own way) and method overloading (same method name, different jobs). You'll also meet abstract classes (unfinished ideas) and interfaces (a contract your code has to sign).

Questions you MUST be able to answer:

  • What is inheritance? Cook up a quick example.
  • Overriding vs. Overloading. What's the difference?
  • What even is polymorphism?
  • When would you use an abstract class instead of a regular one?
  • Interface vs. Abstract Class. Fight! (Just kidding, but explain the difference).
Java syllabus chapter2

Unit 5: Handling When Things Go Wrong (6 hrs)

The Gist: Your code will fail. That's a guarantee. Exception handling is your safety net. You’ll learn about checked exceptions (the ones Java forces you to plan for) and unchecked exceptions (the ones that ambush you at runtime). Your main tool is the try-catch-finally block. You try the risky code, catch the error if it happens, and finally do some cleanup, no matter what. You can even create your own custom error types.

Questions you MUST be able to answer:

  • What’s an exception? Is it the same as an error?
  • Explain try-catch-finally. Why do you need all three parts?
  • Checked vs. unchecked exceptions—give me an example of each.
  • How do you make your own custom exception?

Unit 6: Reading and Writing Stuff (I/O Streams) (6 hrs)

The Gist: I/O (Input/Output) sounds boring, but it's just how your program talks to the world—reading files, writing to them, etc. Java uses "streams." Think of them as pipes. There are Byte Streams for raw binary data (like a JPG) and Character Streams for text. You'll play with classes that let you read from and write to files. Pro tip: using buffered streams makes things way faster.

Questions you MUST be able to answer:

  • Byte streams vs. Character streams. When do you use which?
  • How would you read text from a file?
  • What's the point of a BufferedInputStream?
  • Write a little program that copies one file to another.

Unit 7: Making It Look Pretty (GUI with Swing) (8 hrs)

The Gist: Tired of that black-and-white console? Good. Swing is how you build actual windows, buttons, and text boxes. You'll learn to make a JFrame (the window), throw in JPanels (to keep things organized), and add JButtons and JTextFields. The magic here is event handling—making your button actually do something when clicked. Layout managers are the invisible force fields that keep your buttons from piling up in a corner.

Java syllabus chapter3

Questions you MUST be able to answer:

  • What is Swing?
  • How do you pop up a basic window on the screen?
  • In plain English, how does event handling work?
  • What do layout managers do? Name a couple.
  • Think about how you'd start building a simple calculator. What pieces would you need?

Unit 8: Generics (Making Your Code Smarter) (4 hrs)

The Gist: It's a little more advanced, but it's a big deal to write a clean, secure code. Generics lets you write a code that can work with any kind of object. Think about it that only applications can be captured like making special boxes. This prevents you from trying to put oranges into the account. It is super useful for the collection (Erralist ), and it saves you from the world of bugs.

Questions you MUST be able to answer:

  • What's the big idea behind generics? Why should I care?
  • Show me what a generic class looks like.
  • What are wildcards (?) used for in generics?
  • How do generics keep your collections safe?

Very Important Questions:

  1. What are generics in Java? Why are they important?
  2. How do you define a generic class? Provide an example.
  3. Explain type erasure in generics.
  4. What are wildcards in generics? Give an example of their use.
  5. How do generics improve type safety when working with collections?

Practical Exercises:

The syllabus includes 10 practical exercises to reinforce theoretical knowledge. Below are notes and important questions for each:

Practical ExerciseNotesImportant Question
1. Program to define the structure of a basic JAVA programCovers the basic structure, including a class with a main method.Write a Java program that prints "Hello, World!" and explain its structure.
2. Program to define data types, variables, operators, arrays, and control structuresDemonstrates primitive data types, variables, operators, arrays, and control structures like if-else and loops.Write a program that demonstrates the use of different data types and operators.
3. Program to define class and constructor, demonstrate constructor and garbage collectionFocuses on creating classes with constructors and understanding garbage collection.Create a class with a constructor and demonstrate how objects are created and garbage collected.
4. Program to define class, methods, and objects, demonstrate method overloadingCovers defining classes with methods and overloading methods with different parameters.Write a program that demonstrates method overloading with at least two methods.
5. Program to demonstrate PackageExplains creating and using packages in Java for organizing code.Create a package with a class and demonstrate how to import and use it in another class.
6. Program to demonstrate I/O operationsFocuses on file handling using streams for reading and writing data.Write a program that reads from one file and writes to another.
7. Program to demonstrate Exception HandlingCovers try-catch-finally blocks and handling exceptions.Write a program that throws and catches an exception.
8. Program to demonstrate Layout managersFocuses on creating GUI applications with different layout managers in Swing.Create a GUI application using Swing with at least two different layout managers.
9. Implementation of generic conceptsDemonstrates the use of generics in classes or methods for type safety.Write a generic class that can hold any type of data.
10. Creating a project based on Java using object-oriented conceptsA comprehensive project applying OOP principles, such as a student management system.Develop a simple student management system using classes, objects, and inheritance.

Don't Just Read—Do. (The Lab Work)

This is where you prove you were paying attention. You’ll have 10 labs. They are not optional if you want to pass. They'll walk you through:

  1. The "Hello, World!" ritual.
  2. Playing with the basics: variables, operators, loops.
  3. Building your first class and seeing objects come to life.
  4. Method overloading: making one method do multiple things.
  5. Packages: learning to keep your code from becoming a junk drawer.
  6. File I/O: Reading from and writing to files.
  7. Breaking and fixing: A hands-on try-catch exercise.
  8. GUI design: Using layout managers so your app doesn't look like a mess.
  9. Generics: A practical exercise in type safety.
  10. The Final Boss: A full project, like a student management system, where you put it all together.

That’s it.That is the course. It’s less about memorizing syntax and changing how you think about construction software. It will be challenging, but if you focus on understanding why things work the way they do it, you will nail it.

You've got this. Now go write some code.

More:

Syllabus of java. see more