Java is a strongly typed language where every variable must have an explicit type declaration, and every method must specify a return type, which enables compile-time type checking to prevent errors. Memory tracing involves creating stack frames for each method call, tracking variable values as they change during execution, and understanding how code executes step-by-step in memory. This foundational understanding is essential for debugging and comprehending program behavior.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
CSE116 Lecture 1: Java IntroAdded:
Stop.
All right, let's go.
So, welcome to the CC 1116 summer session. So, the uh you all saw my email. Uh my name's Jesse. I'm Dr. Hartlo. If you want to call me that, that's fine. But I like to just go by Jesse. We can keep it casual. And with that, let's get right into the course.
So, the first thing you need to know, a lot of this you saw in the email, but just to make sure we're all on the same page, is the course website, csse116.com.
This is where you can find everything you need to know about the course.
I got used to this keyboard again. Here we go. Uh, this is where you can find everything you need to know about the course and let's just go through it and get this thing going. Uh, so the first thing you'll see are all the links for the course. Any external links that we need uh are right here. Very first one, obviously if you're hearing me right now, you already found this one is watching lecture. And I want to clear up some of the logistics about this. Uh, we just had a question on Piaza too. So, let's let's clear this up. There's a lecture and a lab on your schedule. Uh, we but it really doesn't work the way they want to schedule it. They want to schedule a lecture and lab. Um, but they give me as much time, actually less time than just lecture in a regular fall or spring semester. So, we do need all of that time just to do the lectures. Uh, so there's no actual lab like you'd be used to in a fall or spring semester. We use that entire time for lecture. And on the schedule, it's 11 to 1:40 with a 10-minute break in between the two. Uh instead, I usually give this up for a vote, but it's overwhelmingly in favor of no break every semester. So, I just do it the the same way now is go from 11:00 to 1:30 with no break and just plow right through. It's live streamed on YouTube. If you need to take a break, just pause the video. uh or re-watch it after like you'll you can get up as you you know as you wish. Uh you do not have to watch live. You can watch the the VODs. There are students in all different time zones. So uh so I like to accommodate everybody in different time zones. So there's no lecture questions.
Again, if you're familiar with the fall and spring, there's no lecture questions, no required attendance or anything for the live streams. the you can just watch the VODs after on your own time. Um, but with the live streams, watching the live stream Oh, the mess got deleted. I was just going to use an example is uh with the live streams, the biggest advantage is that you can interact with me. If you don't really understand an example that I'm doing or I just didn't explain something very well, you want me to give it another shot. So, you can uh really understand what's going on, you can just say, you know, go in chat. I'm always watching chat right here. You see my eyes go over here. I'm looking at chat. Uh post in chat. I'll answer your question right away. Uh unless I'm in the middle of a sense and stuff, you know, uh there's, you know, a few second delay and all that, you know, all that goodness of being live on YouTube, but the uh but the interaction is what you get by watching live. You can't interact with the VOD, obviously. Uh so how would the midterm and final work without the lab time? So we'll with the midterm and final it'll be 11 to 1:30 just the entire lecture time that day will be effectively a lab for the uh midterm and final exam. Those are the one times where you will have to be live. So everybody in different time zones there's at least one day this semester where you'll have to be live. I won't be streaming on YouTube those days. I'll send an email with all the relevant links for the midterm and or or final and then you'll do the the final exam and midterm um you know kind of on your own and then uh submit by the end of the time by 1:30.
Uh so uh so yeah the one big thing with live is like uh Kik just did asking questions in chat. I'm always happy to answer questions in chat. If y'all don't use the chat, it kind of uh defeats the purpose of even streaming live. I could just record everything. Yeah, no problem, Krista. So, our lectures and labs will all be on YouTube, not Zoom.
Correct. So, lecture and lab, you come to this channel Tuesday, Thursday, 11 a.m. Eastern. You'll be able to watch the live lectures. If you miss a live lecture for whatever reason, come to this channel, watch all the past ones. I also have all the past lectures from previous summers. So, if you want to rewatch uh if you want to watch those and get ahead on the material, it's mostly the same. It's the same concepts, but the order has been shifted around a little bit. There's small changes here and there, but uh it's mostly the same stuff. The uh office hours will be on Zoom, though. So, to come to office hours, obviously, we I can't just live stream office hours. That doesn't make sense for that. Uh uh doesn't make sense for the medium for office hours. It'll be uh on Zoom.
Uh thought I had something else, but if I remember. Uh next is AutoLab. If you've taken a I should have made sure I was signed in on this computer. I have a different computer for streaming. So, if you ever see me fumbling around with stuff like this, it's because I uh it's because I'm switching devices a lot.
But, uh this is where we submit your assignments. Again, spring and summer or spring and fall, you're used to this. If not, if this is your first course at UB or your first course with me or or whatever, you haven't seen this before.
This is AutoLab. This is where you'll submit your programming assignments, all your take-home assignments. There are only five of them this semester. They are fairly involved. I mean, you'll you'll see as you get into them. For each of these assignments, the handout is on the course website.
Uh below the syllabus, I'll skip over that for now. And you can see the handouts for every one of these problem sets. They're all released right now.
So, right now, today, you could do all of these problem sets if you'd like. If you want to really just plow through the summer and get ahead of everything, you can do them all. Uh, this is where you'll submit your zip file, submit it, and then it'll autograde it, give you your feedback. You'll get something like this. This is it'll give you your score and a bunch of feedback about your individual methods and tests and uh just a good amount of information about your submission. You are allowed unlimited submissions. as many times as you want to submit uh before the deadline. It'll uh before the late days, we'll get to it in the syllabus, but uh as long as the assignment's open, you can still submit.
Uh and else might be added, but for people redoing the course, can we start the homework and submit when we are done to be on top of things? Yeah. Oh, yeah.
Absolutely. Yeah. So, you can get ahead of everything. And I always get this question a lot. Uh so let me answer it right now is if you're retaking the course and there it is right there actually uh if you're retaking the course and you've already done these problem sets or similar problem sets I do allow you to resubmit code that you've already written. It is important that you understand that code and uh can be able to explain what it is. You are allowed to submit your work if you wrote that code in a previous semester and you still understand how it works. Yeah, if it's your code, it's fine. Yeah, it's not plagiar if it's your code. Uh technically the university policy is that you can't do that. Um but I allow it mostly because I don't have a great way of placing it. I could pull up your old submissions and I don't know if you still understand how that code works.
That's why I make that as the line. I don't see the value in making you physically retype it. It's kind of silly. And even if it comes out, even if you do retype it, it might come out looking almost identical to the code that you submitted in a previous semester. I don't know. It enforcing that seems like a pain. Uh if I want to enforce that, I'll just call you in for a meeting and say, "Explain your code."
And if you can't explain your code, then I don't care if when you wrote it or if you wrote it or whatever. Uh it's just going to be we're going to have issues then. an email I mentioned there were six pound sets but there on the course website there are five did I mention six sorry about that it's five total zero through four I was probably I get I confuse myself with the zero indexing sometimes it's you'd think I'd be used to that by now u for me I'm just doing it same yeah if the questions are the same you can submit the same thing make sure you review it make sure you study it understand all of your code because if I do call you in for a meeting you will have to be able to explain it But as long as you can do that, then what's the point in making you retype it.
All right. Next is our uh the uh office hours. I'll get to that. It's on the piaza post right here.
If you click on this and log in, you can find the schedule. I I'll jump there in a second. This one will take uh be very brief though. All of the examples that I give in lecture, all the examples that are in the slides, you can find in this repository. So for example today we go to topic one hello world Java. This will be excuse me this will be the very first program that we go through. It's just hello world but in Java.
Uh so if you want to follow along with any of the coding examples following with this repo you can take this code put it into IntelliJ and uh and play around with the code. I recommend playing around with the examples, modifying them, predicting what the modifications will do, running it, make sure your prediction is right, so you really understand how each code example works and how each feature in the language works for and and uh at least by Tuesday or uh Thursday, sorry, today's Tuesday. uh by Thursday I'll give a demo on how to clone repos in Intelligj to make sure that we know how to do that and then when I do that I'll uh you can when I once I show you how to do that you can go to this examples repo and grab this link and be able to copy all this code into your Intelligj. We haven't really talked about what Intelligj is yet so we'll uh we'll table that for the moment.
this I want to collapse. And so the next thing is Piaza. You can go here to ask questions if you haven't had this in a course before. This is a Q&A forum where you can ask questions. You can ask them publicly if it's relevant to everybody in the class. But most commonly students will post privately. When you create a post, if you post to individuals and then go to all instructors, then you can post questions about your code submissions and um you know, any any private information that you need. If there's no private information, you can post to the entire class. At least once a semester, somebody posts their uh their problem set code to the entire class. Don't be that person. That's an obvious obviously an issue. Um, so make sure you're avoiding that. Um, but when you go right to Piaza, it will link to the office hour schedule. So, for example, I'll have office hours right after lecture today. Soon as I turn off the stream, I'm going to hop over to Zoom, open up the Zoom meeting, and I'll be there for uh an hour and a half right after lecture. I might have office hours on Thursday, too. We'll see how much traffic office hours gets, how much demand there is. We also have a TA, Miriam, who will have office hours. She hasn't uh I think she's uh out of town at the moment. When she gets back, she'll get her office hours on the schedule as well. Not positive when those will be yet, but they'll be added.
So, the questions are saying, "Yeah, oh, I already answered that." Which will there be time to learn how to make test cases? Uh, yes.
at lecture 7. So, Tuesday, June 16th, that's what I'm going to be talking about the whole lecture. It's talking about how to make test cases. This is one of the changes we made in the course recently, last semester, is we moved testing quite a bit later than it used to be. It used to be week three. So, uh it is still there, but the problem sets that come before it. So problem sets 0, one, and two don't require you to make test cases, but once we get to the testing lecture, the next two, three, and four, uh, problem sets three, and four will have you writing test cases.
Before that, I always recommend writing test cases based on the ones that we give you and then using those as a template to create more. But, uh, not until that lecture are they going to be required.
And good a time as I need to mention if the audio levels some summers like I'll lecture for half a lecture and then somebody will be like, "Oh yeah, the audio was really crappy quality or the audio was way too loud or whatever." If the audio is ever messed up, I do appreciate if you let me know in chat right away if I can try to fumble it around and fix it. If it's just too loud or too quiet, I can I can just adjust the slider over here and fix that. Um, but uh if the quality is crappy, then uh that's something I got to work a little harder on. But uh but always let me know if the audio is way off up or down.
Okay, next is UB Power, which actually we rebranded back to just the tracing tool. Uh, this is where we're going to do our memory diagrams, which if you don't know what that is yet, don't worry. We will get into it, you know, deep into memory diagrams. Uh, and this is going to be nice streaming because I can fit so much. Oh, that's way too small, though. I can fit so much stuff on the screen. Usually, I have to put this on the projector. So, I I just can't fit that much information on.
Probably do have to zoom in quite a bit here.
I don't know why that's looking so blurry.
Uh but this is where we'll do all our memory diagrams. I'll have two of these in today's lecture. So we're going to see this right away right from jump today. And then we're uh what's up? I am stray I am stry. What's up? Uh, and this is where you'll do your midterm and final exams. The midterm and final will be traces. I'll get to that in the syllabus and explain the the details, but this is the tool that you'll use to do the traces. So, I'll do them in lecture using this tool. You'll do them on the midterm and final using the same exact tool. So, you'll be used to the layout. You'll see all the exact buttons that I click when I do my traces. You'll do the same exact thing when you're doing the midterm and final. So, when I'm doing these in lecture, make sure you're paying attention. Hopefully, following along. Um, I have trouble getting students to do practice just traces for practice. Someday we'll require them, but uh for now it's up to you to to do practice traces on your own. And then memory diagram reference.
So, in that tool, uh there's, you know, just a lot of the basics basic usage of that tool. This will go through a lot of how to uh how to do traces for a lot of the topics that we'll cover in the course.
So using this as a reference can definitely help uh if you don't want to rewatch lectures or whatever you know whatever your preference is or do both that reference is there for you. And then uh finally the discord let me catch up on chat though. What are the limits and resources we can use to get help when we need other than AI like geek forge geek? Uh you can use whatever resources you want as long as they are helping you learn in the course. So my criteria is that you have to be able to explain the code that you submit and explain your thought process of how you came up with that code. So, if you go to geek geek forge geeks and you find like basically the solution to the problem that I'm asking, you code that up in your submission, but you don't really understand how it works. You're just like, I don't know, the internet told me to do that. That's going to be an F in the course. That's that's an AI violation. That's no good. Uh, obviously, you can't use LLMs, you know, cloud chat GBT, etc. uh you have to be able to understand what the code does that you submitted for credit and the way I check that is I'll call you in for a meeting I'll say we have to meet send you an email we'll meet on obviously on Zoom since it's a remote course and I'll say tell me how your code works prove to me that you actually wrote this code and a surprising number of students will say oh I just got that from the internet and then I say you failed the course uh which are all these unfortunate conversations. Uh get to the I'll give more details when I get to the AI policy, but that's the uh that's basically what it is.
Will there be tracing practice like we had in the spring semester? I I won't have explicit uh actually I could just use the same practice traces we had uh had last uh last spring. uh but I don't intend to have explicit practic practice traces but you can go to any of the code in the repos or any code that you've written any code on your problem sets and just trace any code I always tell students like you have unlimited practice traces what you don't have are the solutions but if you use the debugger in intelligj it'll give you all the same information that's in the solution of a trace so you can have infinite practice there or you can do a trace trace through some code, then come to office hours with your trace, share your screen and say, "Hey, I traced this code. Can you look it over uh and tell me, you know, where I might have went wrong or if I did good or anything." Uh Miam and I will be always happy to go through a trace and help you practice with traces that way. Uh very few students ever take us up on that offer, but uh I'm always happy to do that. Will the midterm and final be on lockdown bars or no? or or how does the assessment work for the summer courses?
It's kind of on the honor system if I'm being honest. Uh it's so I I'm personally against lockdown browsers. I think it's spyware. Uh but also the cse department we have a policy we voted on and everything and banned lockdown browsers in any cse course. If any CSE course at UB tells you to use a lockdown browser, let somebody know. Let me know if you don't know who else to to come to, let the directors of undergrad studies know. Let somebody know. Uh because we as a department have a stance that we're against it and I'm personally against it as well. Uh that we should never ask students to install that on their systems. Now, that does create the loophole like, well, we can't really restrict what you do uh during those.
So, uh yeah, you're not supposed to use any outside resources for the midterm and final exam.
Can I enforce that without a lockdown browser? Well, I'm not going to go to a lockdown browser. So uh but uh the traces it would follow the same as your written code for your problem sets is if I call you in for a meeting and say explain your trace and you can't explain it you know obviously we're going to have problems at that point. Uh so that's my method of enforcement. Can you go into more detail on how the tracing quizzes will work on the midterm and final? Yeah, I'll go through the whole syllabus. It'll be in there. We'll give um I'll give you all the details about it. Uh the the short of it is uh the midterm and uh you know what I just got to get to on the syllabus. I don't think there's a short way to say it. Um maybe there is there's two categories OP and data structures for traces. And the midterm and final will each have two of each of those. So you get four O op O op traces. Two on the midterm, two on the final. Two data structures traces, two on the midterm, two on the final. And you have to get at least one of each correct. So once you get one OP trace and one data structures trace, then you're good to go for traces.
Will there be any coding quizzes or interviews? No. For the summer course, we do have to trim quite a bit out. So if you're retaking the course from a fall or spring semester, you're going to notice a lot of things missing from the summer. It's mostly because a six-week course and effectively no lab sections and only one TA. You know, there's there's just only so much I can pull off logistically and interviews and coding quizzes got to go. Coding quizzes since it's all remote like what a coding quiz is basically a take-home programming assignment. So, what's the point? Uh interviews just logistically doesn't really work. Uh the traces is the one thing that we can keep from lab. Do we have to do the final if we pass the midterm? No.
Uh, so the last link on here is a Discord. I've been using this same Discord since before since pre-COVID. So there's a ton of students there if you just want to go to the Discord and chat with students from all kinds of grade levels. If you want to ask them about 220 250 or the job market or whatever, all kinds of students there. Uh, or go into the 116 channel and ask 116 specific questions. U I like to just offer that as a uh just as a place for students to chat. In the fall and spring semesters, I'll I'll use that during lecture. I'll be watching it on my phone, but we have YouTube chat, so there's no need for me to use it in lecture at all. But I'll still leave the link on here so you can go chat with people.
Okay.
Where's where's my clock? There it is.
Uh, okay.
So, let's get into the course proper.
That's uh that's all the the external links. Let's get into the course. And these do collapse. You saw me do it briefly before. If you click any on the top bar of any of these sections, it'll collapse. So once you read the syllabus, you're fully familiar with everything in the syllabus. Feel free to collapse it so the content is just further up on the screen, even the links. If you're done with those, and as we go through each lecture, you'll see me start collapsing these, too. So once we get to the fourth lecture next Thursday, uh you know, mine's going to look probably like this. I'll probably have them collapsed. So, if you see that, just uh know that's what's up. I'll always have students like 3/4 of the way through the semester shocked the first time they see that like, I didn't know those claps. I've been scrolling through the whole syllabus every, you know, multiple times a day. Um, they do collapse. So, the course is all about kind of three categories.
Uh, I would almost add testing. Testing used to be one of these two. Um but uh three categories object-oriented programming data structures and algorithms uh with OP we're going to learn about classes creating objects of those classes inheritance and polymorphism with data structures and algorithms we're going to learn three new data structures link list trees and graphs and various algorithms to work with them and then memory as we go through the entire course we're going to do traces of all kinds of programs and you'll do the memory traces on the midterm and final exam.
So those are kind of our three folky in the course. Um and with a a focus on what happens when our programs get large. How do we organize our code?
That's where OP helps. And how do we have efficient run times? That's where our data structures and algorithms help.
And just understanding how everything works is critically important.
uh just as you go through we we do uh traces throughout the semester and you after 116 you might not do another trace. It's not something you'll do in industry. Nobody traces code in industry but it's important to be able to trace code. Anyone in industry you give them a tracing problem. Hey, can you trace through that code that you wrote?
They'll be able to do it. And that's what we want to get in 116. Show me that you do understand how this code runs and then you'll never have to write another trace again. But you better be able to understand and explain how your code runs at the level of a memory trace, which is what happens in stack and heap memory as your program executes. So what's everything that happens in memory as your program goes through? How does the computer run your code? That's really what we we're getting at with the memory stuff.
This is the the first of many. I might actually not dwell on this so much as I usually do, but uh do not fall behind in the course. You saw it multiple times in my intro email. Uh do not fall behind in this course. Every lecture is a week of content in a fall or spring semester. So if you miss one lecture, you you fall behind by one lecture, you you know, you're like, I'll watch the VOD. And then you kind of neglect it and don't watch the VOD for a few days. you're a full week behind in a regular semester.
Uh it it's easy to fall behind if you're like, "Well, he he says there's no attendance. I'll just watch it later."
And then later comes a little too late.
You're really risking failing the course. That's how students fail, especially in the summer. It's true every semester, but especially in the summer, you miss one lecture. You you take a you know, one day you're like, I'll do it tomorrow. I'll do my problem set tomorrow. you're risking failing the course pretty much immediately. Uh things go way way too fast. And and right now we can see where are my stats here? Oh, there it is. Uh somewhere between 24 and 26 depending on what number I look at watching right now half the class is already skipping the first lecture. Maybe they're going to watch the VOD maybe. Um but a lot of students and I've even had you know myself I've done this as a student. uh when it's uh whenever lectures are recorded, I'm like, I'm not going to go to lecture today. I'll just watch the recording. Uh I'll watch it later today and then I just don't and then I'll watch it tomorrow and then I just don't and then all of a sudden I'm behind and then I stack up a few lectures. I get way behind. It's an easy trap to fall into. Half the class is already falling into that trap right now as we speak.
Like um that's wild. That's wild to me. Um, but it's it's easy to not wild to me. I just admitted I did the same thing, but I would get caught up. I I never let it bite me. Uh, and for what it's worth, I never did that in a technical class. I did it in gen eds, but uh uh don't fall behind in this course. I do ex the expectation is 12 hours per lecture.
It's usually 12 hours per week in the regular semesters, but a a lecture is a week of content now. So that's watching lecture and then n and a half I guess hours outside of lecture working on your problem sets and preparing for the midterm doing traces preparing for your midterm and final exams.
Uh doing practice traces. Uh that should be nine hours per lecture. So this is 18 well kind of nine and a half but whatever. Uh so 18 hours per week aside from watching lectures you should be working on your problem sets. That's the expectation uh that it can take a while to learn those to do those problem sets.
Uh admittedly this might be a little less since we don't have the game features assignments. Usually these are the numbers with game features but for some of you you know it might be still 18 hours a week outside of lecture. nine hours per lecture. Uh so don't be surprised if the the numbers get pretty high to complete those problem sets if you're going for max score of course as well. Uh it's going to take a lot. So if you skip a lecture and now you're trying to do 18 hours in a single day potentially, you know, you can you can crunch your own numbers and figure out how easy it is to get behind on on this. Uh, and this does assume that you know all of the 115 concepts. There's a lot of students who get into 116 who squeak by 115 with like a C and kind of barely understood the concepts and just barely got through uh all the assignments in that course. And then they come into 116 with a very weak foundation of foundation understanding of computer science and programming. for them that this number is going to be way higher because you have to do everything you missed from 115 and also everything in 116 all in a six-w weekek time period. I think you get the point. Just don't fall behind in in the summer. Uh stay up to date if you if you are if you're in a time zone where it's currently as I'm streaming 2 a.m. or or whatever you're not going to make the live lectures. Uh, make sure you watch the lectures the same day. If you're putting it off at all, you're really risking falling behind. You put it off two days and from a Tuesday, now it's already Thursday. Now you're two lectures behind and you're basically cooked at that point. There's it's very hard to come back from that unless you already know all the content. But if you're someone who got a C in 115 and struggled in 115, you know, you know what you got to do.
stay up to date on everything. And I'll try to not harp on that too much, but I want to give at least one strong warning for that. For the coding assignments, is there some are there some problems we can't do if we skip over and risk those points? No. Uh so with the in other semesters where we have the game features, they do build on each other a bit. Uh with the five problem sets this semester, they don't build on each other at all.
So, if you do miss one, it's going to be much much harder to pass, of course. Well, we'll get it. Not of course, yet because I haven't explained the points. It's going to be much harder to pass the course, but you will still be able to pick up on the next problem set. I would argue that you probably won't be able to uh the problem sets don't build on each other, so technically you can, but if you can't do problem set one, you're not going to be able to do problem set two.
like the like the like conceptually each one does get a little more complicated, a little different, but a little more complicated. So, if you can't handle problem set one, you're not going to be able to handle problem set two if you're just like, I'll skip that one. It's not a good idea. Not a good idea.
Uh, okay. But technically possible.
Oh, like a part of it. Yeah. If you can't do like the last question of a problem set, last question is usually pretty tough. So, yeah, I see what you mean. Sorry about that. Uh, if you can't do like the last question of a problem set, yeah, you'll be fine. The last question of each problem set is for the most part um meant to be the earn your A question. So, if you can't do that last one, well, maybe you just walk away with a B and don't do the last question on each problem set. That's excuse me, that's perfectly fine.
Uh, you're going to be able to do the next problem set. uh at least the first, you know, 40 points of the next problem set just fine.
Okay, so there's two learning objectives. There's usually 10 in the fall and spring. I kept the checklist format for this, but it does look a little silly only being two things to check off. Um, but here's the the learning objectives. I explained this briefly in response to a question, but let's make sure everybody gets this because it is a little confusing. I tried to word it the best I can, but it's a little confusing still. Uh, so let's explain it and make sure everybody's on the same page with this.
There are two learning objectives of the course that you have to complete to pass the class. So your your grade is going to depend on your problem sets that we'll talk about in a bit, but that only matters if you complete the two learning objectives, which are a a tracing for OOP and tracing for data structures going through a trace on the tracing tool for each of these categories. So in the on the midterm you're going to be given two traces.
You'll get two traces for OP or well four traces total. Two traces for OP and two traces for data structures. The learning objective is to complete a trace for that category. So you have two chances for each of these on the midterm exam. On the midterm, you take the midterm and say you pass one of the and all the traces are graded pass fail.
Miam and I will manually grade them on a pass fail basis. If you pass one of the OOP traces, then you have completed the tracing OOP learning objective. If you pass one of the data structures traces, then you've completed the tracing data structures learning objective.
And that's that's all you need to do is pass one trace of each type to complete these learning objectives and then your grade will depend on your problem sets.
Uh if you don't complete either of these traces, at least one trace of each type, then you will fail the course. You have to do this. It's not optional. It's not, well, I'll just take a hit to my grade. This is you have to do this to pass the class. So everybody has to because it's important for everybody to be able to trace through these programs. It's one thing to write code, but you also have to be able to read code. And this is my way of getting your reading code and your writing code both assessed in the course. So on the midterm exam, you have the two traces. If you say pass one of the OP traces but fail the other one, you pass one of the data structures traces but you fail the other one, you've completed both learning objectives, in a lot of courses that would be a 50% on the exam. In this course, it's you've completed both learning objectives and you are done with learning objectives.
If you pass all four of the traces, doesn't really affect your grade.
There's no extra improvement that for your grade. There's no extra that you can earn by completing all four traces.
You just have the satisfaction of knowing that you did great on all four traces, which is really good. You should all strive for that. Uh but it doesn't affect your grade. Passing either one or both of them uh has the same effect on your grade.
If you uh but just to make sure this is very clear, there are four total traces.
If you pass both of the OP traces and neither of the data structures traces, that means you've completed the tracing OP learning objective, but you have not completed the tracing data structures learning objective. So, you still are at risk of failing the course in that uh in that situation.
If you don't pass at least one trace of each category on the midterm, then you have the final exam. The final exam is going to be the exact same structure, two traces of each type, and it's still the same thing. You have to complete one at least one trace of each type. So, a few different scenarios. In the situation I just explained, you passed one or both of the OP traces, but you didn't get either of the data structures traces on the midterm. You go into the final. Going into the final, you've already completed your OP learning objective. So you don't have to do the two OP traces. You don't even have to look at them. You don't have to open them, but you do have to pass at least one of those data structures traces on the final exam in order to pass the class. So effectively, for each learning objective, you have four chances, two on the midterm and two on the final exam.
And of those four traces for that category, you have to pass at least one of them. So you have to pass at least one OP trace and at least one data structures trace out of the four total that are available across the two exams.
So hope hopefully that makes sense. If there are questions, let me know. So we have the makeup option if we fail the first time on the quizzes. Yep. Uh and if you pass both learning objectives on the midterm, you don't have to take the final. the finals only there as a makeup opportunity because it's so strict. You have to complete both of these learning objectives to pass the course or else you just flat out fail no matter what else you did.
That's pretty strict on the surface at least. So, I want to give you at least two chances for these technically four chances. You have four traces for each learning objective and spread across two separate days that are separated by um by a week and a half. uh well nine days uh separated by nine days for the two exams. So you don't get the midterm, you get this your scores back, you have time to study and prepare, know you have what you have to prepare for, come to office hours, you know, get some tracing help and everything and then go and take the final exam for your second chance.
So you have chances for this. Uh, and for recommendations, what I see a lot of students do, and I it drives me, absolutely drives me insane because I want to see students pass, and this is the one of the biggest things students do to set themselves up for failure. They'll show up to the midterm having never done a trace in their lives. They'll watch my traces and lecture, but they'll never practice a trace at all. like they'll they'll just never do it.
Uh so the very first trace that they actually do on their own is on the midterm or in the fall and spring semesters, whatever the first lab is where we have tracing. That'll be the first race they ever do in their lives is one that that really counts. And I think students do this because they're like, "Well, if I don't get them, then I have the final exam there. I have some backup plans." Uh don't do that. You don't want to go into the You don't want to take the final exam. None of you want to take the final exam. Get it done on the midterm. Prepare properly for the midterm and then you don't even have to worry about the final exam. Final exam day, you can do whatever the hell you want because you're already done with the course. Uh practice, come to office hours with your practice traces. Miriam and I will be happy to look over them and everything and skip that final exam.
That's what I want to see every single one of you doing. Uh hopefully I can just cancel the final exam because nobody needs it. That would be an ideal situation. Um but I've I have uh you know the track record of students preparing for their first trace is uh abysmally low. The pass rates on those are are absolutely atrocious. And then students will study for the final and then the pass rates go up uh way higher on the subsequent attempts. The first attempt is always just abysmal. And when I ask students, hey, did you prepare for that? Nah, I just watched lecture and like come on man, that's that's not um like I I mentioned earlier, eventually I think we have to add like tracing homework, but that's not the reality for this semester, so I won't dwell on it.
But eventually I think we have to have tracing homework to force that. I don't know. Um but prepare for that midterm and you'll be fine. Then you don't have to worry about the final. the final will be because the final is a high stress day. If you need the final, that's a high stress day. So, if you can avoid that, you know, it'll help your mental well-being as well as knowing that you passed the class.
Okay. So, if you complete both learning objectives, then your actual grade depends on the prom sets. Five prom sets, 50 points each. This doesn't really have to be a chart, but there's, you know, in the fall and spring, there's a whole bunch of items on this chart. I kept the formatting and templating and just said, you know what, it's kind of funny as a chart. I'm going to leave it as that. Uh, so every prom set is 50 points. They're all equally weighted, 250 points total.
Uh, and every prom set has a deadline, excuse me, on the course website. So, for example, real set zero is due next Thursday.
Uh the the deadlines are quick, of course, it's the summer, so each prom set is kind of released. They're all released right now, but they're kind of released on a Thursday, and then they're due the following Thursday is roughly how it works. And by released, what I mean is by the time uh the end by the end of the lecture where the problem set is listed on the course website, at that point, you have everything. you're guaranteed to have everything you need to be able to complete that problem set.
So, in two days, two days from now, you'll have everything you need to be able to complete problem set zero. And then, uh, you have one week after that to be able to work on it. And so, oops, I'm highlighting the wrong thing. And submit it before that deadline.
If if you can't complete it by that deadline, there is a late policy for this course. You can still submit assignments late. your pound sets late, add a penalty of 20% per day late. So, if you're two days late, whatever score you get, take 40% off of that, then that's your score for that problem set.
So, if you do miss that deadline, you're working at midnight and you just can't quite get it together right at the the deadline, you can still submit, keep working on it for another day for 20% penalty, another day for 40, then 60.
And if you're submitting at an 80 point penalty, 80%, not 80 point, but 80% penalty, uh you might want to cut your losses at that point. Still do it for practice at least, but the uh the point value you're playing for 10 points at that at that time. Uh you know, anything you can do to avoid that situation would be better for you.
Is there any tracing questions with answers to practice? Uh I think I will.
Somebody else brought this up too already that that uh I think I do have to especially with my uh with what I was just saying how students will go into the midterm not having done a trace. Um I think what will eventually be those homeworks. I think I I just got to develop that and release those uh just so you have some more structured way to practice. I'm going to add that to my to-do list. in fact uh trace practice and then give you some explicit ways to practice these things. I think I got to do that. I think I I uh owe it to you to make that uh easier to prepare for that midterm.
Okay. uh late policy points and then as long as you complete both learning objectives on the midterm and or final as long as you complete those if you don't complete those it's an F in the course hopefully I made that abundantly clear I've repeated that many many times uh that you do need to complete those doesn't matter if you have 250 points on problem sets if you only completed one of the learning objectives and say data structures you failed All four traces for data structures. That's an F in the course no matter what else you did, no matter what else happened.
The midterm and finals are online.
Uh students take this course from all different time zones. Some of them uh take the course from their home countries. I'm not not going to force you to come in person. They're all online. It's fully remote course. Fully remote. Uh, and then if you do complete both learning objectives, then you I won't read the whole chart, but this is where your grade is determined. The big thing is hitting this 150 for a passing grade. So, if you are skipping points on prom assignments or gonna uh you know uh if you're bold enough to skip an entire problem set, you know, there's only 100 points that you can miss and still pass the class. So, the problem sets, which by the way, the problem sets used to be learning objectives and you just had to complete every single part of every single problem set or you failed the course. it got a little, you know, maybe a little too lenient even here.
Um, but you uh but you can only miss a 100 points before you're failing just on points as well. So, if you get a very slow if you get off to a very slow start and you're missing that problem set zero deadline, you get a zero on problem set zero, it's very very hard to recover from that. You got to be nearly perfect for the rest of the semester. And if you completely miss problem set zero, if you're you're capable of getting yourself in a situation like that where you're missing problem set zero entirely, it's probably going to be hard for you to get uh the rest of the four problem sets with only missing 50 points. Uh make sure you're getting problem set zero. It is the easiest problem set. Of course, it's uh problem set zero is 115 concepts, but in Java, it's basically the intro to Java problem set. It's not really 116 concepts yet. It's just getting practice with Java syntax and doing things that you should be able to do from 115. So, uh, don't miss that.
You should all be getting 50 points on that one and then get off to a decent start on these points.
No textbook and any reading uh, is listed on the course schedule. If you need uh, counseling or accessibility resources, here's the links. if you're um you know if you're having a rough go of it. Uh counseling services can be helpful and accessibility resources if you need extended time on exams and things like that. Uh if you have some documented disability uh talk to them, get the paperwork and then I can help you out with things uh things of that nature.
Then AI uh I'll try not to dwell on this too much but uh because I always I mean, it's a big AI is a big deal. Like, we have academic integrity is a big deal and we have to uh uh like my job, a big part of my job is policing this. Uh if you violate this policy, you know, I'm going to do what I can to sounds mean that way, but do what I can to fail you. That sounds awful. Uh I don't want to fail students, but if you have cheated in the course, what I can't allow uh and especially with LLMs these days, it's very easy to just tell the LLM, hey, do my homework, do my problem set for me, and then submit that as your submission. If you're doing that, I I want to I do want to catch you. The big reason for that, uh, there's a lot of reasons for that, but the biggest one for me is I can't let you go into 220 and 250 and go on with the curriculum without learning what you were supposed to learn in CSE 116. Because if you do, then you really only have one option moving forward, and that's to continue to cheat. And once you're in that position, it's extremely hard to dig yourself out of that hole, to get out of that. How do you escape that once you don't know 116? And if you're doing that, you probably did it through 115.
How do you go into 220 and 250 or maybe even get through those courses? You get to your 300 level courses without knowing anything.
The only thing you know how to do is to prompt an AI, which a freaking toddler could do. If that's all you're able to do and god forbid you actually graduate by doing that and all you can do is same thing of somebody who just learned how to type can do. You haven't gotten your value out of your degree. Uh so I don't want to see you get jammed up like that.
So I will be looking for that and making sure that you are learning what you're supposed to be learning. That's the big point of the AI policy is I want to make sure you're getting your value out of your education, out of your stay in college and not wasting your time and money, tens of thousands of dollars in four years of your life and not getting anything out of it. Uh, and especially with an online course, I do have to hound this a bit because I have no in-person assessment of you there. It's hard to maintain that integrity. So, I have to do this by looking at your submissions and if I think it has enough suspicious artifacts in it that I think it was generated these days anyway, mostly most people are cheating with LLMs. If I think it was generated by AI, I'll call you in for a meeting. We'll have a Zoom meeting and you have to prove that you actually created your code. If you can prove to me that you were the creator of your code, then you're good to go. But if not uh then F in the course as you can see F in the course uh and that's it. You'd have to retake 116. So the policy boils down to just these two points. I've tried to make it as simple as I can these days. I give lots of examples for clarification.
A lot of common questions that I get, but these are the two big ones. You have to create your own work and don't help other students violate 0.1. So don't help other people other students in the course uh cheat like uh giving them your code for example.
Uh these days it's mostly 0.1 and using LLM that's the primary way students are cheating and we're getting good at least I am getting pretty good at uh catching this and um and failing students for using AI. uh students who use AI haven't gotten any more clever, but I have and my colleagues have it's starting to not be a good way to get through a course anymore. We're finally catching up to be able to detect and and uh uh convict on this one. So, if you have been h I don't want to dwell on it too much.
Uh but if you didn't create your own work, uh and I'm careful with the wording here, created your work, uh I don't care if you typed the code. A lot of students are like, "Well, I physically typed the code up, but they like they had the LLM generate the code and then they physically copied it over and they thought that that was okay for some reason." You have to be the creator of the work, not the typer of the code.
You it has to be your creation. You had to look at the problem set, use your human brain to come up with a solution, and then code up and implement that solution that you created on your own with your brain. Uh, that's what I need to see. And uh, you can go through all these bullet points. I ain't going to read everyone um, this semester. If you don't plan on cheating, this is all you need to know for the AI policy. All the rest of this is mostly for students who plan on cheating, who want to pick apart the policy and well maybe this and maybe that. Mostly so I have something to point to. So when they do violate it, I'm like, look, I said explicitly that using LLM is not allowed, which is this bullet point right here. any submitting any code for credit without being able to explain how that code works and explain your thought process of why you chose to write the code the way that you did. Uh if you can't explain that, then you weren't the author. Anybody who actually wrote code can explain, oh yeah, I tried this, it didn't work. I pivoted to this and then I did it this way because if I did it the other way, it wouldn't have, you know, anybody who wrote code can explain that whole thought process. If you can't go through that thought process and explain how your final solution works, I don't care where that code came from, it's so, you know, it's not your you didn't create the code.
Uh, and here are just some common excuses that I hear. I'm not going to read them all, but uh just common excuses I hear in these meetings where uh where students will try to give me.
So, I gave those excuses and the answers that I give in those meetings. Uh, if you come into the meeting with one of these excuses at the ready, like you know my response already. And I still get these a lot. Uh, this is always the funniest one. I didn't write the I didn't write that code. Yeah. Yeah, I know. I know you didn't write the code.
Like, not even as an admission, but like they'll they'll be like, I don't know how that code works because I didn't write it.
Yeah. Okay, great.
you you failed. Like I don't I don't understand how people think that's an okay excuse. But uh some students will admit like, "Yeah, sorry I didn't write that code. I I know. I understand the consequences." But some will be like, "No, I didn't write that. Why would you think I could explain that? I didn't."
Anyway, I hate those meetings. The students hate them even more. Don't cheat. Don't get yourself in one of those meetings. Okay, so that's course introduction. Let's get on to some actual content finally.
And uh unless there are any other questions, I'll be watching chat still.
If you have questions, let me know. I have all these slides downloaded, but I always out of habit download them again.
Can I just open it here? I don't This always drives me nuts, but it has the ocular icon. Like it's going to open in ocular, but if you click it, it opens in uh in my browser. I don't want it open in my browser. So, I have to open the folder. Go over here and then double click it. And then it opens in Ocul. I think it's dumb, but And I got to get my control shiftp.
Okay. And I'm not at slide one. Okay.
So, any questions on the course logistics? anything before we start rolling into some Java content and actually talking about the course.
That's the whole preamble. Hopefully you don't cheat. Oh, the one last thing I wanted to say about the AI policy last semester very unfortunately uh uh did end up failing 15% of the class for mostly mostly ex was it exclusively for LLM usage? I think it was exclusively. A few of them were like my uncle helped me wrote that code, but I think their uncle was, you know, uncle chat GBT. Um, that uh that that sucks. Like that sucks. But and and I think there's a lot more than 15% of the class using LLM. And uh I hate to say it, but I think that number is going to go up of percentage of the class we fail for using it as we get better and better at detecting. and and uh and doing that stuff. Just don't use just don't use it. I know the temptation is strong. You have a an oracle right there that can just spit out the answers. Uh don't do it. Don't fall to that temptation. If there's a question kind of ties back into something we said earlier, if there's a question that you're you don't know how to do, like there's some pretty hard questions for the last question of some of these problem sets. If there's one that you don't know how to do, just take the just take the 10, 15, five, five, 10, 15, however many points the last one is, just take that hit to your grade and live to fight another day. Don't bother um, you know, don't bother risking the LLM and risking an F in the course just because you wanted that last 10 points.
It's not worth it. It's just not worth it. Uh, and you can lo you can miss 10 points. you can miss one or two of those questions and still get an A in the course. It's really not worth it. Um, but some students need that perfection even if they can't earn it themselves.
And I had a lot of really unfortunate like uh a lot of meetings last semester were really good students. I I felt bad like I'm still going to do my job, but I felt bad failing them. Um because they they just wanted that that last, you know, couple of points to get perfect in the course when they still could have got an A without those points and and they just fell to temptation on one question. And yeah, that's all it takes.
Uh you use it once and I catch you. It's it's game over, unfortunately. So on that note, I don't want to dwell on the the downsides. Uh the students who are going to do that are probably the ones who aren't even here and won't even watch lectures and are, you know, there's no reach in them in most cases.
Uh so hopefully if I stop one of you from cheating with that spiel, I'll I'll take that as an absolute win.
But yeah, students who are going to cheat are just going to cheat anyway. If you were marked for LLM usage, would that be an F3? Uh I That that's a good question. Uh I would I put it in as an F1, but I think the AI office sometimes changes it. I saw one student with a straight up F last semester. I think the AI office went and changed my F1 to an just a plain F, which I'm not even allowed to assign that grade anymore. Like if I try to give somebody an F without an F1, F2, F3, uh the hub spits it back. Uh so I usually put them in as F1s. it, you know, depending on when I caught them if uh but no, it'll never be an F3. F3 is only if you do absolutely nothing in the course. So, if you've made a submission for me to catch you using LLMs, even if it's on problem set zero, you did do something in the course. So, at worst, it would be an F2.
But for AI, I think I'd always put it in as an F1, which if anybody doesn't know what we're talking about, F1 is like a regular F.
F2 and F3 are are uh Fs due to lack of participation depending on how little you uh participated and I don't like assigning the F2s and F3s personally. Uh I I only do it if it's really justified because the only thing it affects is your financial aid and I don't want to be messing with that. Like why am I messing with your financial aid? Uh I only care if you passed the course or not and what grade you earned if you did. Uh, I don't like messing with the F3, but if somebody literally does nothing, registers for the course and does absolutely nothing, I'll still give them the F3, but it's pretty rare thing.
Definitely not for AI purposes.
AI, if you do get caught using AI, I want you to be able to recover from that. I don't want to mess with your financial aid on top of already having to retake the course. That's just cruel, personally, I think. All right, but let's get into some content. Let's talk about Java. Hello world. Just right where every programming course should start is hello world. Uh so let's do it.
You'll see hello world again. Even in my 300 level course, we start with hello world as a client in server sending an HTTP request and response. It's more complicated, but still hello world. This is where we like to start. Uh so with Java, uh hello world is actually pretty complex. This is the simplest Java program we can write with Java uh 25. Is it now? With Java 25, they just changed the language. Like earlier this year, they just changed the language or maybe the end of last year, the end of 2025, they just changed the language. So, some of this isn't required anymore. Uh, but I'm still going to go through the whole all the steps because you'll still see lots of Java code in the wild that have all of this uh extra stuff on there. So, let's still break down every piece of this and maybe someday we'll teach the simpler way from Java 25, the new fancy way of doing it. They finally simplified hello world. It took them three, four decades. Uh, they finally did it. Uh I think it's way too late to change now. But anyway, uh here's hello world in Java. Let's just break down every piece of this thing. So the first thing that we see is a package declaration. So the package declaration is uh is what package this code lives in which for Java is a onetoone relationship with the directory structure or the folder structure. I always use the word directory. Some students uh never heard this before.
They they always talk to them talk about them as folders. It's perfectly fine. So when I say directory or folder, I mean the same thing. I mean the location on your hard drive of where this thing lives. And this is relative to the source directory of your project. For everything that I give you in 116, that'll be a directory named src, short for source, which is common across, you know, the entire industry. If you see a directory named src, that's where the source code goes. And relative to that directory, then we go into the package declaration. So you can find this file in a directory named source/week 1. And if you go into uh the examples repo, I did change these a little bit. It'll be topic one Java basics, I think it is now. Uh so slight differences um but that will be where you can find the code in the examples repo is the package declaration uh for any code. So if you're ever looking at code and you're wondering where that code lives, you look at the package declaration. If you're ever wondering what the package is, you look at the directory structure. That's going to be the package for that code. Java does enforce that onetoone relationship.
So, if you have a package declaration that doesn't match your directory structure, you will get an error and Java will say, "Hey, fix your stuff because we like to be organized around here. Uh, just make sure your packages match up with your uh with your directories." And then I'm going to create a class. So, I have I'm going to skip the keyword public for now. I'm going to create a class named Hello World. And I'm creating a class because Java is an a strictly objectoriented language. And we'll dive into all of what that means. We'll create objects and classes and all this stuff. For now, just know that a class is a container for all of your code. And in Java, all of your code has to be in a class. You need to put your code in a class. So if we're writing a Java program, we have no choice other than creating a class as a container for our code. So that's what we're going to do. We're going to create a class. And here I'm going to name that class hello world with a uh upper camel case is our naming convention for classes. So capital H, capital W. And when I create this class, I'm going to have and the advancing a slide is so laggy.
Uh, I'm going to have to have this code in a file that matches the class name.
And this is another thing that Java does enforce. Your class name has to exactly match the file name for that code. So, I have a file here that's creating a class named hello world. That means that this code has to live in a file named hello world. Java. If it doesn't, Java is going to uh let me know about that. It's going to say, "Hey, again, we like organization here. And you have to have your class name match your file name.
And when you have a file, that file can only define one class. That's the whole purpose of a Java file is to create one class. So this hello world Java file.
Its whole purpose is to create the hello world class. And combining that with our package declaration, just looking at the code, we know that this code lives in a directory named source/week 1. and then in a file named hello world. Java. So looking at any Java code, you can figure out where that code lives.
Then we have our main method. Every, you'll hear me say this a lot throughout the semester. Every Java program since the dawn of time has always started with a main method. Every Java program starts with a main method. So if you want to run a Java program, you don't just like run a program. Like in Python, if you're coming from 115, you write a Python file and it's a script. It'll run your code starting at the top of the file and just run all of your lines of code sequentially. That's not how Java works.
Java will always start at a main method and that's the entry point for your program. So if we were going to write a Java program, we got to have ourselves a main method. And a main method looks like this. It has to have a lot of components aside from what I mentioned of Java 25 did kind of simplify this did simplify this a bit. I'm going to still teach it the old way. I think Java 25 you just need void main and then you can have an empty argument list. I believe that's how how far they simplified it.
Um but we're going to go through all this uh every part of this. So here and I'll give a brief overview of everything.
By the time we're done with the course actually by next Tuesday I believe right we'll have a good understanding of all of these keywords public static void and the string array. We'll talk about all of this stuff eventually most of it next Tuesday. Uh for now I just want to give a brief overview a very brief oneliner on each one of these things. For these we have the keyword static.
Static means that we can call this method without doing extra work. We're going to see on next Tuesday the extra work is creating an object of a type defined by a class. And we'll talk about all that stuff that and that's how we can do non-static methods and call those. If we don't want to do any of that, we don't want to think about objects yet, which we don't, then we're going to make our methods static, which means we can just straight up call this method without doing anything extra. No objects created of those classes. Void means this method doesn't return anything, and we'll talk about that a bit more when we talk about strong typing and methods later today. Main is the name of the method. So, this is similar syntax to most programming languages. We have the name of the method here which has to be main all lowercase m a i n all lowercase letters.
And then we have the parameter list which takes one parameter named args and it takes an array of strings which would be our command line arguments which is admittedly something that we're not going to use in 116. In 220 you start using command line arguments. 116. We're not going to use them, but this is the syntax for an array of strings.
Now, your main method. Oh, yes. And then uh public means that you can call this code from anywhere without having to do any extra uh not extra work, but you can call this code from anywhere. Uh there are other uh these are called access modifiers.
There are other access modifiers, uh, private, protected, and then the default if you just don't use any that limit who and from where you can access the code.
Uh, public just means it's a free-for-all. Everybody gets to call this code. If we're going to have a main method, it's got to be public and the class itself has to be public so that Java can access this main method, call it, and actually start your program. So, a main method's got to be public and our classes are all going to be public as well. So we can actually use that code from other classes from other files in our project.
Uh so that's our main method. Our main method has to have all of these ingredients public static void. It has to be named exactly main all lowercase.
It has to take one parameter of type string array. And then uh the one thing that can change this args is a variable name. And you're welcome to name your variables whatever you want. By convention, we usually call this args across languages. You know, it's just convention to call if it's your command line arguments, we just call it args. Uh but technically, this could change and you still have a main method. All the other ingredients public static void main string array, all of that has to be there or else you don't have yourself a main method. And if you don't have a main method, for example, you name this with a capital M, that's not a main method anymore. And the difference is that you can't run it as a Java program.
Java won't recognize it as a main method. So, it's no longer able to serve as an entry point for your program. So, you have to have all those all of that to be able to run this uh run this as a Java program, which is why we don't use Java in 115. We actually used to, but that's why we don't use the Java 115 anymore because the equivalent program in Python is print hello Python.
That's it. Like that's all you do day one of 115. Much much simpler. With Java, there's just so much stuff that we have to talk about for our very first Java program. In most classes, they'll just say, you know, ignore most of this.
And that's kind of what I'm doing as well. Right now, we will get to it all eventually. Not today. Um, but you basically ignore most of this and just say, "Oh, trust me, you have to have all this stuff or else you don't have a Java program." and then you start learning Java. Like if you took Java in high school, that's what they usually would do.
That's what they should do at least in my opinion.
Uh so that's a lot just for Hello World.
And by the way, we haven't even printed Hello World yet. We still got to talk about the code. We haven't even gotten to the code. Uh so there's a lot of moving pieces just for a Java program.
Luckily, Intelligj has us covered in a lot of cases here. Intelligj is Oh, I forgot to mention this going through the the intro to the course but Intelligj is the IDE that we in I don't want to say endorse but uh support is the IDE that we support in CSSE 116 and recommend so if you use Intelligj every you know everything with the course is made to work in Intelligj and that it will work in Intelligj and if it doesn't work in Intelligj Miam and I will support you come to office hours if you're having issues with Intelligj we'll help you out we'll help you get that all sorted. You are allowed to use other IDEs. You can use whatever you want. You can use text edit if you want.
You can use whatever the hell you want.
I don't care. Um, but if you have issues that are caused by an editor that's not Intelligj, Miriam and I aren't necessarily going to help you out. If there's no queue in office hours and we're familiar with your specific issue, then maybe, you know, we might, but there's no expectation of support for other environments, if you're avoiding Intelligj because we did a lot of work, you know, I've done a lot of work making sure everything works in Intelligj uh to do that in another ID. Like a lot of people like to use VS Code. Uh VS Code doesn't really play nice with the way we have things set up for Intelligj.
Specifically, running the tests. I already had somebody with this issue this semester. Um running the tests in VS Code is uh VS Code likes a very specific structure for the programs and if you don't follow that structure, it doesn't like to run your tests. Now, without a whole bunch of work behind the scenes, you can go into the command line and run them manually with a lot of pain and suffering. But you can get it to work, but it's it's not worth it. Uh just download Intelligj. You can rightclick the test and click run and it just runs. Uh so I I really recommend Intelligj, but if you want to go through that pain and use VS Code or, you know, whatever else you want to run, go for it. You want to use Eclipse for whatever reason, go for it. But uh uh just know that we won't give support for that if you have issues specific to your environment. If you're using VS Code and you have questions about the code and about uh the concepts of the course, we're of course still going to help you with that. But if you have an issue like I'm having trouble compiling in VS Code specifically because of VS Code, you know, we're not always going to spend our time on that. There are better things that uh we can all be doing.
You can click download Intelligj and solve that problem immediately. That's the solution that we have available for you.
Okay. Uh but uh anyway, so what in intelligj you can type main. If you're in a new class with no code in it and you type m a i n then there will be an autocomplete option. You hit enter and it'll write public static void main string array args. It'll do all of that for you. So those are all the components that you need for a main method. But in Intelligj kind of just has you covered and you don't have to memorize all of that stuff. Uh I think the new main the new shortcut will do the new way of doing things. So unfortunately this is getting a little sloppier now. Uh so if it doesn't add all of this stuff for you, you might have to add more. Is that even true? I don't think that's even true actually.
Uh that you might have to add more because we're not running Java 25 in AutoLab. But also, AutoLab's never going to run your main method. So, I think it's I actually think that's fine. I don't think that would cause issues. But if it does, add your public static void main string arrays, add all the extra stuff.
And now, now we can write some code after all of that. Uh, an hour 15 minutes into the first lecture. Granted, a lot of that spent talking about the course itself, but after all that, we can finally write some Java code that runs. And this uh this itself has to be more complicated than it needs to be. Again, Java 25 lets us just just do print line. We can finally omit the system.out. But uh in the the old ways, and you'll see a lot of code that looks like this, including all the code I'll show you this semester, is system.out.printline is our equivalent to print in Python.
This is going to print whatever string you give it followed by a new line character. If you do print without the ln, it won't have the trailing new line character. So this is how we print in Java or in Intelligj, you can write s out and it's going to type all this for you. It's going to give you the entire uh it's going to give you this whole line. Uh so you don't have to remember system.out.print line. And then you finally run this program. It's going to print hello Java to the screen.
And every statement in Java ends in a semicolon. I don't have much to say about this. Just don't forget your semicolons. But if you forget your semicolons, Intelligj will be like, "Hey, you forgot a semicolon on line six. You should probably put one there."
Uh, and it'll give you a red underline, a squiggle right here, and you hover over it says you should put a semicolon right here. It used to be a big deal remembering your semicolons in programming. It used to be a a big pain.
With modern tooling, modern IDs, it's really hard to forget a semicolon. Like, you can forget one, but the ID just slaps you in the face and says, "Hey, you forgot it. Put it just put a semicolon right here." And it's easy to uh recover from that mistake very very easily.
Okay. Okay. So, I think right here and if we don't get through all the we might not get through all the content today, but Thursday uh you know some of it can spill over Thursday and we'll stay on track. Um but I do want to since we don't have lab usually we have a lab that goes through Intelligj setup. I do want to do some Intelligj setup right here now that we've seen our very first program. I'll do this pretty quickly.
Um, but let's let's do the examples repo and let's get this example in right here so you you can get started on things right away.
The examples repo. What I'm going to do is go to the repo and copy this link.
This is the same exact thing you'll do for the problem sets. When you go to problem set zero, there's a GitHub link for each problem set. It's going to look the very similar to the what I just did.
And then you go to code and copy this link and that's the URL for that uh for that repository. Repository is uh a place on GitHub where we store all the code. So I can share code uh with all of you. Makes it convenient to be able to do that with getting this link really uh really easily. When you go to download Intelligj, just make sure you download the one for your version. I'll accept cookies. Uh, download the one for your operating system. The website's pretty good about choosing your operating system for you. I'm on Windows right now, so it selected Windows. If you're on MacOSS, make sure you get the one for your design. If you have a Mac these days, it's probably Apple Silicon. Uh, but if you do have an older Mac that's still Intel, just make sure you're getting the right one. um for your system. Same with Windows. If you're on a Windows ARM machine, make sure you're getting the Windows ARM installer. So, make sure you're downloading the right one for your operating system. And then once you download that, of course, I already have it downloaded. So, let's jump to Intelligj. You'll see you'll see something like this.
And when you're at the initial splash screen, you want to go to clone repository and you're going to paste that link.
And IntellJ does most of the work for us here. You're going to paste that link. I have one extra step that I have to do.
I'm already going to have a directory directory where I clone this named class example code. So I'm going to put a two here. Actually, I probably already have a two from a previous lecture example, but I'm going to click clone. and that already exists. So, let's go three.
Probably already have a three as well.
Nope, I don't have a three. And that's going to download all of that code from GitHub and download it onto my machine. So, all of the code in the examples repo is now in my Intelligj, even if it it was already, but now I downloaded it a third time into my Intelligj. Same thing with your problem sets. You do the same thing. download the uh download well you already have Intelligj downloaded by then but uh but go to clone project and paste that link and then you'll get all that starter code for each problem set as well downloaded into Intelligj. If you're already in a project, say you're you're done with problem set zero, but you open Intelligj, it opens right into problem set zero, you can go to your menu, go to get and clone, paste your link, and then it's the same thing. If I want to do a four here, I can download this a fourth time. And you can download a new project when you're ready for the next problem set. if you don't want to go back to the splash screen, but you also saw me go back to the splash screen by going to close project. You can get back there that way as well. When you do clone a repository, you'll see a bunch of progress bars along the bottom. Right now, it's for some reason taking a while to clone, which I don't know why.
Yes, I would like to open it. Uh, and then you'll see a few more progress bars.
They go by pretty quick. Oh, and they're all gone. I can't even explain them because they went by so fast. When you when you do this, what's happening is uh IntellJ is reading this pom.xml file and this pom.xml is downloading any dependencies that we need. For our purposes, it's Oh, I still have Twitter 4j and oh yeah, because this is the examples repo. Uh to4j is an old dependency we used to use previous semesters and the big one that we use is JUnit. So you see JUnit right here. This does not come with Java. This is an external library but it's downloaded through the pom.xml. So if you have any issues running JUnit uh JUnit test, that means something might have went wrong there. But it's pretty automatic. It's pretty free these days and works pretty uh pretty darn well. And then when I will go to run my code, sometimes you'll see this up here.
You need to download a JDK first. So I'm going to go to configure and uh you won't have any JDKs available by default. So you go to download JDK and whatever the default is is usually fine.
The pom.xml uh actually let me just do the default and see if this is going to work for us.
In the pom.xml we have it specified as 25 right now. Uh we have to update it every time a new version comes out and apparently 26 came out since that was my default.
Uh and it's downloading. We can see the progress bar down here.
Oh, hey. I'm going to have to make this bigger, ain't I?
Can y'all see this? Fine.
Might have to I have to adjust my settings for for the summer.
Uh 20.
Let's go with 25.
Hopefully that's better. Uh so now that that progress bar finished, it downloaded the new I uh JDK and I'm ready to be able to run some code. I get these green go buttons here. I can also rightclick on a file and go to run, which is the one I'll choose to do here.
And that should compile and run my code.
Yes, I want to allow the JDK to run.
Windows has got to protect me.
And then we get hello Java print to the screen down here. So, we got our first program running. We cloned a repo. A lot of steps there. They go by quick.
Obviously, you can rewatch the video uh and you can come to office hours. We can help you out, get you set up with everything. But that's I do got to get back to slides. So, let's jump back over here.
Uh, and if there's anything else, I can jump back to uh, Intelligj if you have any quick questions. But I did want to get that demo in. We got it in there at least.
And, uh, talking about Intelligj set up.
Usually, we have a whole lab. We have a two-hour lab where we're setting up Intelligj and multiple TAs walking around with students and getting everybody set up. So, we're doing an summer abbreviated version of that.
Uh so uh yo let me know if you have questions post on piaza come to office hours uh or ask right now.
Uh okay so let's get on to some more content. Where are we? We have and I always I always get tripped up in the first few lectures of the summer. We go till 11 to 1:30. 2 and a half hours.
Yeah, 1:30.
We go till 1:30.
So, I got some time. Let me Oh my goodness.
I'm going to set an alarm for that even cuz just in case I lose track of time. I want to make sure my phone's going to tell me to to stop talking. Uh or else I'll go like half an hour over or something. I don't want to I don't want to uh put you through that, I guess. Uh okay. So, let's talk about or else I would just go on a run and do the whole course in one day. Actually, I would just rip through it all. But, uh let's do this and then you'll be overwhelmed.
Of course, you could rew.
Uh, so let's talk about variables and methods. And I've been talking about methods. I said main method was the one that I said a bunch of times already.
Main method. Main method. Main method.
You might not have heard the word method before. Uh, in Java, we have methods.
Uh, and we don't have functions, but methods and functions are mostly interchangeable. If every time I say method, you hear function and you take everything you know about functions and apply it to methods, you're going to be just fine. There is one subtle difference to methods and it's the the context, the keyword this stuff that we'll talk about on Tuesday. I I'll uh mention it when we get there. Um but for now, just know that Java doesn't have functions. It has methods. A method is something that would be a function that we normally know as a function that is defined within a class. Since Java, every wouldbe function is defined inside a class. We only have methods. So everything in Java is a method. Uh no, we don't have functions.
Uh we do have something called well it doesn't matter. Some called Lambda functions, but they're really actually not functions. they're objects and doesn't matter though. Doesn't matter at this point unless you're interested in here and I'll be happy to answer questions. But uh uh but we only have methods. So let's talk about methods and variables in Java. And a lot of this you're going to know from 115 or whatever your CS1 course was. If you did u AP uh CS in high school or you transferred from another university, doesn't really matter where you came from. You're going to know a lot of these concepts. the assignment operator uh declaring variables um you know uh defining functions which are now going to be methods like a lot of these things you'll know so I will focus on the Java specific differences that are new to Java and especially if you're coming from R15 the things that are new from coming from Python to Java if you're coming from anywhere else our our CS1 course is taught in Python so I I'll emphasize the differences between Python and Java a bit more. If you came from a language that say has strong typing, the next thing I'm about to talk about, then yeah, you can chill a bit. You'll already know that concept. Uh but most of our uh students at UB won't have heard of that yet. Uh coming right out of 115. So, Java is strongly typed. This is the first and biggest thing that we need to know about Java. And this will permeate throughout the entire course.
Talking about typing is uh just a huge thing that will permeate through everything that we do and it's probably I would say the biggest reason why we teach 116 in Java is so we can talk about all the things that we need to talk about because it's strongly typed be very hard to talk about the concepts like inheritance and polymorphism in a language like Python wouldn't really work out so much. But anyway, what does strongly type mean? It means every single variable in Java needs to have an explicit type.
So this variable that I named num and assigned a value 2.4.
This num, I can't just create a variable named num. I have to create a variable named num of a specific type. And the type for this variable I'm specifying as double. So I'm saying I'm creating a variable of type double. I'm going to name it num and I'm going to assign it the value 2.4 and that's a statement so I end it in a semicolon.
When I declare a variable of a specific type, that variable can only ever store values of that type. So this variable num can only ever store a double, which a double is a numeric value that can have a decimal portion.
This variable num can only ever store a variable of type double. If I try to say num equals some string, that's going to be an error and my program won't run. Uh that's going to just break everything.
I'm not allowed to reassign num to a value that is not a double with only very very few exceptions. I can assign num a value that's an integer and then Java will convert the integer to a double without loss of precision. We can just do that. That's fine. But I can't assign like a string, a value of type string to num. It's not going to let me.
Num can only ever store a double. That's how what strong typing means. I have a variable that is a container for a value of type double and that's it. That's all it can ever store. So that's in a nutshell is strong typing. That's like all you need to know. Uh everything else is derived from that. I'll still go through everything of course. Um but there are lots and lots and lots of implications of that. Uh but that's the core of it. That's what strong typing means is our variables all have types and can only store values of that type.
So this whole line I'm declaring a variable named num. I'm assigning it the value 2.4 and that variable is of type double. A and whenever you reassign so there's a variable declaration. We're declaring a variable. When we create a variable for the first time, we specify its type. When we're reassigning the variable to a new value, like we do in the next line, we do not specify its type again. We only specify its type when we're declaring the variable, which declaring and reassigning those kind of get blurred in Python because the syntax is the same. In Python, you'd say num equals 2.4, num equals multiply by two.
the the first line you declared the variable, the second line you reassigned it, but it's the same syntax both times.
In Java, we do have to be aware of the difference between declaring a variable and reassigning a variable and using a variable. We only specify the type when we declare the variable, which is where we create the variable for the very first time. We specify its type and then its type is is known for these three other usages of num in this method.
the type has already been de declared as double. We don't have to specify it again. And if you try to specify the type again, Java will think that you're declaring a new variable and then it's going to give you an error because you're going to try to declare two variables with the same name and it's going to say you can't have two variables with the same name and and uh cause issues. So, we only specify the type when we first declare a variable.
And we have our first method. the method definition and the method call. A lot of this is the same in just in any language that you would have taken for a CS1 course. Uh calling the method, we specify the name of the method and then an argument list and then defining the method we have the method name and then the parameter list. So the Java specific stuff is pretty much all the rest of it is public static. I'm going to stop talking about public static. every method that we have for the first part of the course until we get to problem set one and next Tuesday's content. Uh so really just for two lectures in the summer but it's two weeks in a regular semester but for two uh lectures the first two lectures every and problem set zero everything every method is going to be public and static public so we can call the method from anywhere which is going to be from our test cases for the problem set and my other test cases in autolab when I'm grading your code I I need to be able to call your methods so they need to be public and then static meaning we don't have create objects or worry about objects yet. We'll worry about that next week. Uh so everything will be public static just so we can call these methods without having to jump through a whole bunch of hoops and without having to to do a bunch of extra stuff that we'll talk about later in the course. So for now we're kind of pretending that our methods are just functions. Public static methods behave just like your functions in Python or any other language with functions. It's strict input output behavior. you give it some parameters, you return some value.
You know, that's if you don't know where you're headed, you might think, what else would you do?
Um, but we'll see. We'll talk about objects and state uh starting next Tuesday.
So, I'll stop mentioning public static just for the first week. Everything is going to be public static. That's that's just going to be the natural state of things for a little bit here. The next thing is a another new Java thing uh coming from Python at least is the return type. Every single method you declare in Java must have a return type.
And that return type is a very rockolid contract that you're signing with Java saying this method will return a value of this type. So my multiply by two method is going to return it has a return type of double meaning that it will 100% of the time return a value of type double and it has to return a value of type double and you have to specify the return type. So Java will always want this for every method and you do have to hold to it 100% of the time. Uh breaking this contract will break all of your code. So, Java just doesn't let you even think about breaking that contract. So, with this method returning a value of type double, that means I can safely make this method call. I know that this method call will resolve to a value of type double. And I'm assigning its return value to a variable of type double. And Java is going to check to make sure all of our types match up. So since it knows this method will return a double, it's going to say, "Yeah, you can safely uh store that value in a variable of type double." And all the types check out. That's what strong typing is doing for us is it's letting Java do all this checking for us to make sure that we don't have any obvious bugs in our program where we're mixing types.
In Python, you just have it uh issues like this. Uh the Python isn't going to check your types at all. it's just going to try to run your program and if you mess up your types, if you have the wrong types in the wrong places, program just crashes. So, Java's doing a lot of work to help us have fewer bugs in our program, which is much much appreciated, especially when your programs get large.
A large Python program, it's very hard to keep track of all of your types.
Eventually, you're going to make some mistakes. With Java, the language itself makes sure that we don't have any type errors. And the biggest one you probably saw in Python is when you're trying to print a string to the screen. You're trying to do print and then as a string the value of x is and then concatenate x the variable of type int to that string.
And it says you can't concatenate a string in an int. You're not allowed to do that. And you go, oh crap, I got to put my str and then parenthesis around my value to convert it to a string first. You can't make that mistake in Java because Java is going to have all this strong typing that's going to make sure you don't write code like that. Or if you do, it'll say, "Hey, just so you know, I think you got an issue over here. You're trying to concatenate a string and a an in an int." Uh, that's not going to work for you. Which incidentally, I do on this very slide.
Uh, which since I brought it up, I got to talk about it here. Uh, I do on this very slide. I do concatenate a string with a double. Java's string concatenation operator is very powerful, very sophisticated. What it will do is if you have a string and then plus, it'll treat this as a string concatenation operator and then whatever the other value is, it will automatically convert it to a string for you. So, we actually don't even have that same issue that we had in Python.
We don't have that issue in Java uh because string concatenation is so powerful in Java. it'll automatically do your type conversions for you.
Okay, so now we have our types, our return type, and our types are all matched up.
And then for our parameters, and we actually already saw this in the main method, and I intentionally didn't talk about it then, but our parameters are variables.
All variables in Java are strongly typed.
Therefore, our parameters in Java have to be strongly typed. Every time you have a parameter in a method, they all need to have their type specified. So, I'm saying this method takes a parameter of type double and will return a double.
In the problem set language that I I do in PS0 especially, I would word this as write a method named multiply by two that takes a double as a parameter and returns a double and the value it returns is the input multiplied by two.
That would be the problem set description of this method if this is what I wanted you to write in that problem set.
Uh so this is taking a parameter of type double. So when I call multiply by two, when I call this in the main method, I'm giving it the value of num, which is an expression that's just a variable. So it resolves to whatever is being stored in that variable, which is 2.4 as a double.
So I'm giving multiply, excuse me, multiply by two a double, which matches its parameter type. So Java is going to be happy about that. Java's going to say, okay, you told me this method takes a double. You called it with a double.
We're cool. We're good here. We're good.
uh but every parameter also since it's a variable needs to have its type specified and then the actual code of the method there's nothing really special here I could just say return input x* 2 I split it into two lines just so I had an extra variable declaration since we're talking about variables I we can create variables inside our methods so I have a local variable x of type double being assigned whatever the parameter is multiply by two and then I'm returning x. So since I return x and x is of type double and I have a return type of double, my return types all match up. So everything's good there. And this method only has one path of execution. It's going to execute these two lines every single time it's called. And that results in returning a value of type double. So we're all good. our return type is checked out.
The a code block in Java is defined by two braces. So everything in between the braces is part of that code block. I have a code block defining this method definition between the two curly braces and inside those braces indentation does not matter. So coming from Python where indentation was king here indentation doesn't matter. You should use proper indentation just for readability, legibility of your code. But the language itself doesn't care about your indentation. Uh it cares about the braces to define code blocks and semicolons to define the end of a statement. So uh Python doesn't use either of those. Python uses indentation for both new line characters for the end of a statement and then indentation for a code block. So bit of a difference coming from Python.
Uh, and if you have conditionals, we'll talk about conditionals. Uh, oh, today we should, uh, it might spill over a little, but, uh, potentially today. And, uh, once we get to conditionals, when you have multiple paths through your method, if you're returning inside of your conditionals, your if or your else ifs, every single possible path through your program has to result in returning a double. And if it doesn't, then Java is going to be mad about that. Uh, then that can cause some actually I haven't seen that mistake in quite a while, quite a few semesters, but it can cause some issues if every single path doesn't lead to returning.
So, for example, if you say if return a double, else if return a double, and then nothing after that, Java is going to say, well, what if both the conditions are false? You don't have an else statement and you don't return anything after your if. Uh so Java would would not like that because if both conditions are false, you go to a non-existent else and then you don't return anything. So every single path through your method must result in returning a value of the appropriate type.
So when we call this the this uh does what you would expect it to do. There's nothing new for Java here that we haven't already talked about, especially since I talked about the string concatenation ahead of schedule here.
Uh, but num is being assigned the value 4.8, the result of this method call.
Then printing to the screen, new num and then I have my space. I didn't have that on the previous slide. Uh, new num and then 4.8. So that's what's printed to the screen. New num colon space 4.8.
And then we have one extra method here.
This method Y. It's named Y because why would you ever do this? You would never write a method like this unless you're teaching a lecture and you want to talk about the void return type. Uh so I'm calling this method Y which has a return type of void which is our way of saying this method doesn't return anything. So you have to have a return type but that return type can be nothing or void. So if your return type is void, it just says your method doesn't return anything and it's called for its side effects. In this case, the side effect is printing to the screen the string I return nothing.
You notice that the main method return has returned type void. And uh the main method isn't called for any return value. It's called to start your program. So we don't need any return value there. In other languages, you would return an int. Uh you know what?
But I don't even want to talk about that. Or do I? Uh, Java does return an int, but it's behind the scenes. We don't have to return an int, but we still need that status code for the operating system. Uh, but Java hides the details of that and we don't have to care about it. And then once we reach the end of the main method, that's the end of our program. So as soon as you hit that closing brace of the your main method, program's over, memory is cleared up, everything's done.
So, Java is strongly typed. We just talked about that. We went over our variable types, parameter types, and return types. We have to have types all over our code. But I only talked about one different type, not even different, one type. Uh, that whole example that I just went through had doubles.
Technically, we saw string and string array. Um, but let's talk about a few of the common types we'll use. There are four types that are going to get us through quite a bit of the semester. Uh, and then we'll start combining these and creating objects. We'll talk about that next Tuesday. But these four types are going to really get us through quite a bit. So, first double.
I briefly talked about this. I just said it's a number with a decimal portion.
Actually, I'm not going to expand on that very much uh until we get to the testing lecture. When we talk about testing, there is there's some complication with doubles. We can't always store a number exactly in a double. There will be some truncation which we call double truncations or truncation errors because usually they do often create errors in our code because we don't have exactly 2.4.
Actually, I think 2.4 we have exactly.
But some numbers can't be represented exactly in a double. Some we'll have to worry about when we talk about testing.
Um, but it's a number that can have a decimal portion. That's the that's the oneliner for it. A string is just like a string that you would uh work with in any other language. A string is a sequence of characters. And notice that the type string does start with a capital S while these other ones start with lowercase letters. The any type that starts with a lowercase letter is a primitive type. S with a capital letter is going to be a class type. We'll talk about the differences differences between the two when it becomes relevant. Um but yeah. Yeah, we'll just talk about when it's relevant. Actually, it'll be relevant later later today in a little bit. So, we do in CSC 116, we treat string as though it were a primitive type. In our memory diagrams, we will pretend that this uh these string variables work the same way as our primitives. Meaning that they are storing values directly. Whereas most of our class types will store references to objects on the heap. And if you came from 115, just like your list in dictionaries were references to objects on the heap, most actually all uh types that start with capital letters, these class types in Java are references to objects on the heap. String is not an exception, but we do pretend that it's an exception to make our memory diagrams simpler, or else our memory diagrams get way way too complicated uh for no actual educational gain. So we do pretend that uh but for now at least notice that that's a capital S and that will become pretty relevant. Uh for other types that are in capital letters. Ints are whole numbers. So these are numbers but they cannot have a decimal portion. Uh they are allowed to be negative. Same with doubles. They can be negative as well.
And the big thing to know about integers is that if you have an int divided by another int, the result has to be an int. You cannot divide two ins together and get a double as a result. The result has to be an int. And the way Java reconciles this is if there is any remainder, it is just removed completely. So if there would be a decimal portion, the decimal portion is just truncated. So 6 / 4 you would expect it to be 1.5 but the 0.5 is completely erased and you only get the whole number uh result of the division.
Uh this is effectively taking the floor.
So if you have 99 divided by 100 the answer is 0.99 the.99 is truncated and you just get the zero. So something to always be aware of if you have two ins, if you don't want integer division, you would have to make sure one of the two values is not an int.
Then boolean. I don't have much to say about this. It's either true or false.
Any language you've learned, you've talked about booleans. True or false, for what it's worth, it's lowercase t, lowercase f. In Python, it was capital T, capital F.
Right? We're going to do our first memory diagram. I'm going to take a very brief break. I'll be back in 1 second.
Just give me one second.
And we're back. All right. So, we want to do our first memory diagram right now. We're doing it.
So, our first memory diagram. I'm going to go through a slightly modified version of what we just saw in the slides. mostly so I can get everything on one slide, but also like little things adding a parameter to the Y method just so I have a few more things I get to talk about in the memory diagram. Uh in the rest of the slides, I do have a memory diagram laid out. I used to do memory diagrams in the slides. I left them there. So if you do want to click through the slides and have my commentary on the memory diagram in slide form, you know, I just left that there for you. Um, but I'm going to do these live in the tracing tool. So, I am doing them the same exact way that you're going to do them in your uh in your traces. So, I'm going to grab this code from the repo in this variables functions in the topic one Java package.
You can see I'm in a directory topic one Java. So, the package is topic one Java matches up. Uh, variables functions is the class. So, variables functions has to be the file name. like we talked about earlier, we have everything matching up uh according to that. So, let me jump back to the browser, go to course website. I'm going to go to the memory diagram, the tracing tool, and I'm going to go to the practice side of this. Uh when you actually you won't ever go to the instructor side. Why would you uh the instructor portal? When you do the traces for your exams, I'll email you the four links for the four traces and it'll take you directly to a trace uh with the code already pasted down here. You already have the code right here um for the uh for the midterm and final. So, I'm going to switch this set this up. Java. I want um was it F11? Full screen. Hide the toolbar.
Resize. Oh, I don't have to resize. And let me know if that size is fine.
It's hard to tell. Feel like I It's I'm not downscaling anything. I don't know why it seems to be coming out a little blurry, but I don't know how that looks on on y'all's end, but if it's tough to read, let me know. I can make this uh make the font bigger. Actually, for this one, I can just make it bigger now.
There's no point in in holding out on you. I don't need this much room.
Let's do this.
We're not going to need the heap. I'll leave the heap there, but we're not going to use the heap for this uh for this trace. And I will go through if you did take 115 here. I am going to do a bit of review. Not everybody has taken 115. So, for some of you all, this will be the first trace you've ever seen in your life. So, I will explain every part of it. Though, some of it I might go um decently quick through. But, let's do this. And how we doing on time? We got 35 minutes. I want to get through this trace and at least some of the next slide deck.
I think we got that. I think we got it.
Uh so very first thing we're going to print to the screen. Whenever we uh actually very first thing so we have three methods in this Java program. When we run a program we always always always start with the main method. That's where a program starts. The open brace of the main method. We go to the first line of code first statement. That's where things always start. So the very first thing that's that happens is we're printing I can print to the screen. For that we go to our IO section and this is where we put everything that's being printed to the screen. So I can print exclamation. That's the first thing that happens in this program. This gets printed to the screen.
Next we have our first variable declaration. Actually I forgot the very first thing that happens. Uh the very first thing that happens every Java program always starts with a main method. So we have a main stack frame.
If you're coming from 115 in Python, we had the global variables section which aren't really globals but you know whatever. Uh with one uh with Java every single program starts with a main stack frame. So we have a stack frame for our main method and that's where the variables for the main method will go.
every everything is in a stack frame.
Every variable on the stack is inside of a stack frame. There is no global section. When I switched from oops when I switched from Python to Java, Python will have that global section. When you switch to Java, it does better syntax highlighting for Java, but it also gets rid of that global section because that does not exist in Java.
So, I have my main stack frame. Every method call corresponds to a stack frame. When a method is called in a program, there's a space on the stack that's allocated for that method call.
We get the space for that method call.
Well, that's it's a bit of a misspeak, but it's not really relevant to 116.
is we get this um stack frame and then all the variables that are declared locally inside that method are declared inside this stack frame and then when the method call ends the stack frame is destroyed and all the variables in that stack frame are removed from memory. So the first thing we have in the main method is a variable named num. We have our name column and our value column named num being assigned the value four.
So that goes into our main methods uh stack frame on the stack in memory.
The next thing is num two being assigned the value 2.4.
Num two is the value 2.4. And notice when we're adding variables in our memory diagram, we don't specify the types. I'm not saying a variable num of type int or num two of type double.
Nowhere in our memory diagrams in our variables for our memory diagrams do we specify any types for reasons.
Uh the I I I should expand on that at least a little bit more. Uh mostly because it doesn't matter when we get to polymorphism week. I will dwell on this and make a big uh emphasis a big point of it. Um but the types don't matter at runtime. And when you're doing a memory trace, what you're doing is tracing through what the program does at runtime as opposed to compile time before your program runs. Java is going to check all your code for any errors.
That's the only time where strong typing matters, which is also why Python can't have strong typing because Python's an interpreted language, not a compiled language. But we're getting into the weeds at that point.
uh the short short answer the short uh there was no question but the short statement for that is uh we don't put the types in our memory diagrams that's for a good reason because it doesn't matter and then num three. So strings technically are objects on the heap and they're immutable in Java and they're weird.
Strings behave very weird. Uh what we're going to do to address that is ignore that they're weird and pretend that they're stored by value. So when we have a string, we're going to put the value of that string as though it were directly in stored in the variable. This is not how it works under the hood, but it is how we're going to simplify things in 116. So we don't have a lot of complexity in our strings. We would have a total of 1, two, three, four, five, six, seven.
Did I miss any? Seven different objects on the heap for our seven different strings that appear in this program. And uh I'm not doing that. Actually, would it be actually I think it'd be nine because num three would have to be converted to a string and then concatenated. So I think it'd be nine.
num three and num two. Uh anyway, we're not putting you through that. We're just going to pretend they're stored by value. Then we don't have to worry about all the object creation that's happening with these things. Uh and then finally, we have num not finally, but we have num three.
Beautiful named variables. 6 / 4 you would think would be 1.5, but since these are two ins, it'll be just one.
So remember, integer division is a thing. And then bool with the value tree.
We're going to print to the screen. This would be I believe this would be three different string objects on the heap you would have to create to actually do this properly um to just do a single print statement. That's not something again not something I'm going to put you through.
And then the value of num three. uh whenever I have to reconcile a variable when I'm doing a trace, I don't like looking at the code, uh then I have to rethink, oh, six divided by four integer division. Uh I don't have to do that.
I'm always going to look at the the variable. So, num three, I'm going to look it up. It has the value one and I don't have to really think all that much. I am I am num three value one because I'm looking at it here. And that's exactly what the computer is going to do when you're doing your traces. you are doing exactly what the computer does. There's no imaginary stuff aside from simplifying strings that I mentioned, but there's no imaginary stuff when we're tracing code. We are doing exactly what the computer is doing when it's executing your code. And what the computer will do is look up num three in its stack. Look for the uh symbol num three and then look at its value which is sitting right next to that variable.
So that's what I like to do when I'm doing my traces. It limits my mistakes and it's more accurate.
And then we have a method call.
So whenever you have a method call, you have a new stack frame. So I'm going to click the create stack frame button. And the name of the stack frame is going to be the name of the method being called.
So multiply by two dow.
And we're going to set the return variable. So this method call is returning to the variable num 2. So I'm setting my return variable to num 2. And that's a nice visual indicator of where the return value is going to go when this method is done being called.
And I have one parameter. The first thing we do, well, I already did a few things, but when we create a stack frame for a method call, we're going to put the parameters on the stack frame. So I have a parameter input being assigned the argument num 2. And again I'm not looking up here. I'm looking up here.
Num two is 2.4.
Happens to be the same in this case, but often it's not. Often you'll miss if you look at the code, you'll miss some reassignments sometimes.
Uh so I like looking at the the stack.
Uh and now that we have our parameter assigned to our argument, then we're ready to run this method. We're ready to go through the method call.
Uh, and notice so the main method does have an argument. Technically, args is in the main stack frame, but this is another simplifying thing that we do in 116. Since we never use this string array of args, we're not going to trace that. We don't have to trace that. If we did, you have to put args and then a reference. Create an object on the heap for an empty string array. And again, there's no point in making you do that every single time for every single trace. That'd be your first step. It's no point. No educational value to be had there. Just tedium. So, skip it.
And we're ready to run this method. We declare a variable x.
We're going to take input, which is 2.4, multiply it by two, so we get 4.8.
And we're going to return x. So when we return our method call is ending which means our stack frame is being removed from memory. So the multiply by two stack frame along with its variables input and x are being removed from memory. They no longer exist in memory.
Now for our memory traces for our tracing diagrams which memory trace and tracing diagram I use interchangeably by the way if I try to stick with just one but I I slip up. We've changed the names of them a few times and just all the names get mixed in my head. If you hear me say either one of those, I mean the same thing. So when it's removed from memory, we don't erase it from our memory trace because we are tracing through everything that happened in memory during the execution of the program. And when our trace is finished, we want all of that history. So even though this stack frame is removed from memory and the next stack frame, the Y call that we're about to do, that will use the same location in memory is multiply by two used to occupy and it will overwrite everything that was there. That's what's actually happening in memory for our traces. We're just going to cross them out to so we still have the information there because when the program ends, the main stack frame is removed from memory. So if we uh didn't cross them out, if we actually erased them, every single submission that you have for your traces would have an empty stack. Every program ends with an empty stack with absolutely nothing on it.
So there's nothing really to grade like how do I grade that? How do I make sure you actually trace through everything?
It'd be silly. So we just crossed them out. But when it stack frame is crossed out, it is actually gone from memory.
And what it did was return x. X was 4.8 when it still existed in memory. So we're going to update the value of num 2. To do that, we don't just change the value. We're going to click this plus sign, cross out the old value, and put in the new value 4.8. So we never again, just like why we cross out the stack frames, we want to preserve all of the history of what happened throughout the execution of this program. So we're going to cross out 2.4 to say, okay, it used to be 2.4, 4, but now it's 4.8. Now looking at the final trace, we'll be able to see that numbum was 2.4 and was updated to 4.8. So we preserve all that history. We can see everything that happened in this program.
And then we get to another print line.
New num, new num two.
Uh, new num two colon space. And then num two. I'm going to look up num two, which is 4.8. Again, if I look at the code, I might I mistakenly do 2.4. I'm not going to redo all this work or anything. I'm just going to do what the computer does. Num two. Well, that's 4.8. Very little thinking I have to do if I'm doing the same thing the computer does. Computer don't think at all and it can do this. I'm going to think as little as I can when I'm doing my traces. And that'll be a theme. I'll bring that up a lot. Uh, but I like to turn my brain off a little bit doing a trace. It should be mostly automatic.
You got to learn the rules of how things work in the trace. Once you learn those rules, you you execute them just like the machine does because that's what you're simulating is how a computer runs this program. And a computer just follows a set set of rules. So y, this is another method call. So it's new stack frame with Y named Y. Y has one parameter val and its argument is two as an int literal and then Y is going to print I return nothing to the screen.
I return nothing and there are two ways to end a method call and to end a stack frame. One is by explicitly returning something by using the return keyword and the other is by hitting the closing brace of that program. For anything with a nonvoid any method with a nonvoid return type, you can't just let the method end by hitting the closed brace.
You have to have a return statement to specify the value that's being returned.
For our void methods, both y and the main method, we don't have the keyword return. we just let them hit the closing brace and that's what ends the method.
So we hit the closing brace of Y, cross it out. So the variable val is no longer in memory. It is erased from memory. And then we return execution back to the main method. This resolved to nothing.
It just returned void. That's the end of the statement. Move on to the next line.
Hit the closing brace of the main method. Cross out the main method. And that's our final trace for this for this code. That's our final trace is uh nothing left on the stack, but we still have our stack frames just crossed out. So we can still look through the history of what happened. We had a main stack frame. We had a multiply by two stack frame. We had a y stack frame.
Here's all our variables, what their uh initial values were, their final values, any updates in between, and also everything that was printed to the screen throughout the execution of this program. So, one thing we could at least do, I can print I am num 3 1, I am num two uh new num 2 4.8. I return nothing.
We should at least get all of that if we run this program. So, if we go, which we can do, we have Intelligj open. We have this program ready. Let's run it. Make sure we get all that same stuff. We get all the exact same print statements when we do run the program. So, it's one way we can verify at least uh to an extent what we get when we run this program. And since I can't resist, I'll do do my first uh debugger. I'll keep this extremely brief. We don't really have time for this. But if we click the a line number, if we click the first line of main specifically here, and then instead of running the program, we'll click the debug button. We can run this program in the debugger. What this does is shows you all of the same information that we put in the memory diagrams except without our simplifying assumptions. So ours is going to be on the stack here, but I have my main stack frame. And as I go through my code, I can click this step into to advance one line at a time.
And I can see my main stack frame getting all these variables just like we did in our trace.
We can go to console to see what's printed to the screen. We got these two things printed to the screen so far. And then when we have our method call here, multiply by two. We're in the multiply by two stack frame with input having the value 2.4 and then x having the value 4.8. And I can click back to my main stack frame to see what all the variables are here and see all the same variables here as well. Click through here. That stack frame is actually gone because that is what actually happens.
But in our traces, we would cross them out. And then num two is has been updated to 4.8. When this prints to the screen, I'll jump to the console. Prints to the screen. New num 4.8. New num 2 4.8. and then y in the y stack frame we have val equals two it'll print to the screen I return nothing then that stack frame disappears it's gone and then we hit the end of main and the program ends so you can see this all the same information that we did in the trace you can see in this tool called the debugger which I'll find time for a more thorough tutorial later in the semester um but you can do all the same information in the debugger So if you want infinite practice with traces, get good with the debugger and then use that to practice your traces.
And that has the double effect of helping you with your assignments. When you're doing a problem set and you're struggling with that, running the debugger will almost always show you what your bug is, what the issue is in your uh in your code.
All right, which brings us So, we will spill over a little bit.
That brings us to the end of our first slides. We're going to jump to the next one. We'll get as far as we can here. We might be able to get a whole trace done.
I'm hopeful.
Let's replace it cuz I don't know. I don't know why I do that, but I just do.
Let's get Let's get some if statements and loops.
Okay, so here's our first program that uses an if statement.
This program is going to take a numeric grade and uh output a student's letter grade.
Uh which is an example we will revisit quite a bit later in the course actually. know in testing weeks been really pushed back.
Uh but let's talk about uh if else if and else. And I honestly don't have a whole lot to say about this uh this program. Even without even if you're this is literally your first time ever seeing Java, you can probably still trace through this code pretty well. You start with the main method. You're doing letter of 98. Uh maybe uh well we did just talk about this but integer division 98 / 10 is going to be 9. 9 is greater than equal to 9. So we're going to return a and then print a to the screen. 75 we get seven. That's going to give us a c. And then 30 it's going to give us a three. That's going to hit the else and we're going to print an f to the screen. So we should see a cf printed to the screen. Uh that's what this code does. It's looking at the 10 digit and using that to be able to figure out what the letter grade should be. And you know what? I better say this right now because I last semester I said it way too late and it wasn't relevant anymore. Uh but in your problem set there's a sum of digits method. The intended solution for that sum of digits method is to use a combination of integer division and modulo 10. So if you take a number modulo 10, that's the percent sign, that gives you the remainder of a division only. So if you take a number and you take it modulo 10, that's going to give you exactly the ones digit. And then if you have integer division by 10, what that'll do is effectively shift all of the digits to the right by one and erase the old ones digit. And now what used to be the 10's digit is now the ones digit. And now you can modulo 10 again, get the new ones digit, which was the 10's digit, and add that to a running total. If you want to add up all of the digits of an integer, you can repeatedly do that. Do modulo 10 to get the ones digit, then divide by 10 to erase that ones digit, modulo 10 to get the the original 10's digit, then divide by 10, now modulo 10 to get the original hundred's digit, and just keep repeating that until you're out of numbers to read. That's the intended solution for that without uh the intended solution. That one's pretty tough. Um but the lecture examples are meant to guide you through that. But the other the modulo part comes in testing week which is way too late for that uh when we switch that and you know things just got shuffled. So I want to give that hint out there right now uh to uh be able to do that sum of digits because otherwise it's a pretty tough question if you're trying to solve it from scratch.
Um I've seen a lot of creative ways to solve it but that's my intended solution for that why I think it's a fair question uh because we walk through the examples in lecture. Okay so conditionals in Java uh indentation doesn't matter the code blocks are defined by the braces open brace and closed brace for each code block. And if you're coming from Python Python's kind of the oddball out it says l if instead of l spelling out else if. It's one of the weird things with Python where Python will spell out everything to be basically English sentences. Then for else if they just randomly delete three characters. I I don't know why. Um but uh else space if is how else if is written in Java and then else. And the behavior is just like you would expect.
It doesn't matter what language you're coming from, Python or or whatever else.
Uh the syntax for a conditional is the same in just about any language.
certainly any language you would take for a CS1 course. Um the it's if and then some boolean expression. Else if some boolean expression and then if all the expressions are false, we'll go to the else and fall through.
Okay, let's see that in a memory diagram. We'll at least get through this trace. I'm pretty confident. So let's go to our code.
Uh black example.
Oh yeah. Plus actually this is kind of a big big example.
That's been all this. Don't ask. I'm sure I'll never make a mistake.
Okay, let's trace through this. So, every Java program starts with a main method. And I'll start going through these a little quicker. The first one I just in case you've never seen a trace before, I wanted to explain quite a bit.
But here I I'll start picking up the pace. So, letter until we get to the new concepts, of course. So, letter, this is a new stack frame called letter. It's going to return to a variable named result. And we do put the variable on the stack with no value just so we have a place for the return arrow to go to.
And then letter takes a parameter of uh named score which is getting a value 98.
And then we're going to create a variable 10. It's going to be integer division score divided by 10. So this is going to get the value 9. Then if 10's greater than equal to 9 return a. So this method ends and we get the value a returned in result.
That's a whole method call. Uh we have another method call. Oops, I didn't print it to the screen. Print a to the screen. And we have another call to letter and we will have stack frames. If we call the same method multiple times, we get two stack frames with the very same name. Uh that's fine. That's just, you know, that's the way we roll.
um when we're grading we'll know we'll look at all the context clues the parameter values and everything and figure out if you trace through everything properly.
Uh so we have 75 and then 10 is going to be seven. So we have integer division.
Uh and then we have if 10's greater than equal to 9 that is false. So 7 greater than equal to 9 is false. So we go to the else if 7 greater than equal to 8 is false. So we go to the else if 7 greater than equal to 7 is true. So we're executing this block. And this is a new thing for Java that we haven't seen in Python. The way Python handles code blocks is different. Uh with Java, we're going to use this create code block button, which has always existed, but in 115, you just would never touch this button. But create code block. Whenever we have a code block inside of a method, we're going to create a code block and put all of our variables that are declared inside of that code block inside of this dashed box for that code block.
The reason for this is when a code block ends in Java, any variables that were declared inside of that code block are destroyed as soon as that code block ends. So, we do have to be careful about how we create our code blocks, which admittedly isn't very important for this one because we're ending the method call inside of this code block, but it will be important for, you know, moving forward. We'll we will have to keep track of this. So, this is your first taste of it.
with uh well I'll wait for the next one.
So we have this code block and then the method ends we're returning C. So the code block ends. So return is no longer on uh no longer in memory but the entire method call ends as well. We return C. I forgot my return arrow. We return C back into the main method and then print C.
And we have one more call of letter where score is 30.
10 is going to be three.
And then we're going to go through three greater than equal to 9. False. False false. False false. And we hit the else.
And else return f. So, we do have a code block here. We enter a code block, but you notice for the first call of letter, I didn't create the code block. I didn't bother with that. And I'm not going to here either. So, I can create the code block, but there won't be any variables declared in it. The reason to trace through our code blocks is to keep track of which variables are currently in memory. So, once that code block ends, any variables declared in it are removed. That's the only purpose of tracing code blocks. So if you have a code block and there are no variables declared in it, we don't have to trace that code block. Another thing that we're just not going to force you to go through the TDM, there is a code block here. So if you do want to trace these and have your code block and just put no variables in it by deleting the variable that's created by default, that's fine. That that's good. You can do that. You're more than welcome to do that on your traces, but you're also more than welcome to just omit the code block entirely. If you have a code block with no variables declared within it, you can just omit the entire thing completely and that's perfectly fine.
Uh, and then this will return f. I got to get my return arrow.
Uh, frame ends and then we have the value f in result and then print result to the screen. print f.
And for what it's worth, this is a very minor thing, but if you really want to be particular about things, when I have a variable of type string, I'm going to put the value in double quotes.
And when a string is printed to the screen, I'm not printing it with the double quotes because that's the way the program does behave. If uh I won't go back to the debugger right now, but the debugger when it shows your strings, it will show them in double quotes. But when you print to the screen, you don't get double quotes all over the place. It just be a lot of clutter in the output.
So there's no double quotes around what's printed to the screen.
And hell, we did get through that trace.
That one actually goes pretty quick.
So let's jump back to our slides. We can at least introduce loops, though we won't get to the loop trace.
today.
Uh, let me jump out of presentation mode. Skip through. So, again, I have the memory diagram in the slides still.
I left my old memory diagram. So, if you want to go through my commentary on here, more than welcome. Download from the course website and go through them all.
I'm going to skip it in lecture though because I did it in the tracing tool.
So, loops, we have a few different flavors of loops. We have our well loop and our for loop in Java.
And a well loop is uh which actually I think they teach you in 115, but if you haven't seen well loops before, let's just go over them briefly. A well loop has the same syntax as if statements. So we're going to say well some boolean expression execute this loop. And as long as this boolean expression is true, we're going to keep going around the loop. So we're going to check this expression. If it's true, we execute the body of the loop. Then we check the conditional again. If it's true, we execute the body of the loop again. Then we check the condition again. And we just keep doing this until the condition is false. Then we skip to the end of the loop and continue with the program. So we're going to loop while the condition is true or until the condition is false.
Notice that a well loop and actually a for loop as well in Java uh or any program I suppose uh any language doesn't have to execute at all. So this well loop the way we have this set up this well loop will not even execute a single time. So don't use the body of your loops to initialize anything because you might get your values uninitialized. If this is the situation, then val5 greater than one is false and then this loop never ever ever executes.
So if you're doing like a min problem, you want to find the min of some value and you're like, well, the first iteration of the loop is just going to get the value for of the first uh first whatever in my data structure and uh and go from there. Um that's not always going to happen. If the data structure is empty, for example, you're just going to return your default value. So just something we always got to keep in mind when programming your loop might not execute any times, might execute zero times.
And then the for loop, we get the definition. I'll probably revisit this next time uh just to actually maybe I'll go right to the memory diagram, but uh let's at least get it out there. The for loop in Java is compos composed of three statements. In Python, you wouldn't even have this style of loop. For some reason, Python decided to not give us this style of loop. Uh for Python, this would be for x in range of five would be the same thing here. Uh this is the style of loop in most languages, most mainstream languages at the very least.
Uh where we have three statements. We have an initialization statement which is executed one time when we first reach the loop. A conditional which behaves the same way as the condition for a while loop. We're going to execute while this condition is true. And then an increment statement which is executed after each execution of the body of the loop. Uh, and we're going to use some I'll reiterate that, but uh, but we're also going to use some extra syntax, some uh, fancier syntax than we do in 115. 115, we don't even have this syntax available, this plus+ syntax, this increment operator in Python. But even if we did, we like to avoid it in 115.
It just causes too many issues. Um but the uh uh for people brand new to programming it can uh people do like x++ uh equals x + one and end up incrementing twice. They just get things confused like that. Uh in 116 you're ready for more advanced syntax. So x++ is the same as saying x= x + one. So what this will do is increment x by one.
does seem simple when I say it like that, but when you combine that with assignment operators, there's a a hidden assignment operator can confuse students, but you're all you're all good for that right now. Uh, and that's the this is the structure of it. So, we're going to get to the loop, execute the initialization, check the expression, if the expression is true, execute the body of the loop, then execute the increment statement, and then check the condition again. If the condition is still true, keep doing, keep looping.
And we'll do the memory diagrams for conditionals uh for conditionals and loops. No, we already did conditionals for loops when we start on Thursday. But my alarm went off. It's my cue to not hold you hostage to get out of here. Uh so I'll jump right to office hours. If you go to the Piaza post for the office hour schedule, here's the link for the Zoom meeting.
I'll join that meeting. Uh, make sure you're, you know, I have it written right here, but if we use breakout rooms for office hours, so I'll be in a breakout room. So, if you do join office hours, it might look like you're in the room by yourself. Um, but I'll see you call you into the breakout room and then answer your questions there. I might be with another student. So, if somebody showed up before you, I pulled them into the breakout room. I might be helping them. And then once I'm done with them, I'll call you in. So, it might just look like you're sitting in a meeting by yourself and you're looking around wondering what the hell's going on. I'm probably with another student in the breakout room. So, just, you know, chill for a sec and I will get to you. If it's during office hour time, I'll be there.
I can't miss office hours because it's right after lectures. So, I it's not like I can forget about it. I'll be there. I will be there, but I will be in a breakout room. If I'm not with anyone else, you'll join the meeting and I'll call you into the breakout room right away. Uh, but I'll head over there. If anybody has questions, hit me up in the Zoom office hours. Other than that, I'll see y'all on Thursday for more Intro to Java. Take care, everyone.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 views•2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 views•2026-06-01











