Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [java]

Questions about instruction specific to the programming language Java. Use this tag only when the language used would affect the question significantly (if your question uses Java as an example, but does not focus on the language itself, you need not use the tag).

1
vote
3answers
124 views

Is it okay to teach C++ to my 7 year old brother?

I was thinking this for quite long, should i teach my little brother about programming in the age of 7-8? Because it will help him in the future in 12th standard and in university life. I want him to ...
3
votes
2answers
89 views

Project based on game 2048

I'm thinking about an assignment based around the game 2048. This would be towards the end of a first programming course at the university level and assumes the students have been introduced to at ...
4
votes
7answers
128 views

Mental Model of Type Conformance/Subtype Polymorphism

I'm finding that my CS2 students really struggle with the notions of type conformance and subtype polymorphism in Java. Say we have the following: ...
6
votes
2answers
114 views

First project in my second year data structures intro

I am currently teaching the pretty much normal second year Data Structures and Algorithms course. In this course there are four programming projects, with the first project completed the automated ...
2
votes
1answer
55 views

Example for Introduction to Generics in Java

Any good example classes for introducing generics in Java? I'm introducing this in the context of implementing ArrayList, but I don't want my first example to be <...
30
votes
11answers
8k views

How can we teach good naming practice for students learning Java?

In writing software we name things. In Java we name classes, interfaces, methods, variables, etc. How can we teach both the importance and the skill of choosing good names? What teaching practices ...
5
votes
4answers
88 views

Use of jshell in AP CS A

I recently installed jshell in my IDE for use in demoing concepts in AP CS A. It came at just the right time as it was a powerful way to teach ArrayLists and its ...
9
votes
7answers
435 views

My teacher said that java is pass-by-reference when the type is not a primitive

I am an undergrad student. I am an experienced programmer. For reasons out of the scope of this question, I ended up in a class where basic things about C++ and Java are being taught (but I already ...
6
votes
1answer
208 views

Is there evidence of differences in the outcomes of objects-early vs objects-late?

Here is the essential parts of a (HS) Junior level question from one of our (Canadian) national computing challenges. (http://www.cemc.uwaterloo.ca/contests/computing/2017/stage%201/juniorEF.pdf) ...
6
votes
4answers
440 views

Motivation for learning C++ when you know Java

I am going to teach a C++ course to students who already know Java. From answers to my previous question, I learned that C++ is substantially harder to master than Java, particularly because of the ...
6
votes
4answers
462 views

Using Oracle's Java Documentation as a Teaching Tool

I'm in the process of preparing for the second semester of AP CS A (Java). I want to review objects and classes with my students to prepare for our extended focus this semester on inheritance and ...
5
votes
3answers
265 views

Teaching C++ to students that know Java

I am now teaching an OOP course to 2nd year undergrads. This is actually a course in advanced programming in Java. In the next semester, I am going to teach the same students, a C++ course. From what ...
-1
votes
1answer
106 views

Help in choosing elective subject

I am a student of B.Tech CSE and have an option to choose any one of the subjects in the next semester. Below are the options: Enterprise Java Digital Image Processing Compiler Design I want to ...
2
votes
2answers
108 views

Teaching intermediate Java to students familiar with C

The class I teach (a class whose teacher I assist1, to be precise) is learning intermediate Java this year (data structures, basic OOP and a few lessons about how Java actually works). A few of the ...
6
votes
7answers
820 views

Example for For vs While Loop (in Java)

I'm looking for a set of concrete examples that illustrates good use cases of using a for vs a while loop for beginners. I feel ...
4
votes
2answers
109 views

Choosing Java-like language for teaching web development

I just started teaching an introduction to web development to high school students (they have the most basic knowledge of java) and this year my school has decided to make a change in the curriculum. ...
6
votes
2answers
259 views

Teaching OOP in Java, to students who already know Java

I am going to teach a course in object-oriented programming in Java, and am looking for materials - textbooks and slides. It is a course for 2nd-year undergrads. In the 1st year, they already learned ...
4
votes
0answers
327 views

Using zyBooks and labs

Has anyone used zyBooks in their classes? I've seen some good comments on the SIGCSE list about them. I would primarily use this in our CS I class (Java) with their lab feature as a way to provide ...
17
votes
9answers
2k views

The order of subjects in beginner's curriculum

This year I'll be an unofficial teacher assistant in the CS class of 9th graders. Background This question is about a curriculum for introducing students to programming in java. The students are ...
3
votes
1answer
92 views

Ideas for introducing databases to Android development students

I teach an Android development course to students who have had two full years of Java experience - including a year of data structures. In the past, my students have used services such as Firebase, ...
5
votes
3answers
327 views

Framework choice for AP CS A students: Swing or JavaFX?

I attended an AP workshop this week to prepare for teaching AP CS A this coming school year. It gave me my first glimpse of Swing, which has now piqued my interest about including some GUI components ...
5
votes
3answers
277 views

Lesson plan for teaching java graphics

Background: This lesson should give a firm foundation for graphics in Swing in java to students in high school who know OOP in java (...
6
votes
11answers
1k views

Teaching the tradeoffs of the foreach loop

Edit: It's been quite a while since I posted this question, and in the intervening time, I have come to love the foreach loop. However, in order to avoid invalidating answers, I leave the text ...
13
votes
4answers
462 views

The impact of switching to Java 10

Java 9 and 10 were both released recently -- Java 9 was released on Sep. 21st, 2017 and Java 10 was released on Mar. 21st 2018. These two releases contain some very big changes: Java becomes modular ...
7
votes
6answers
230 views

Where can a student independently learn elementary recursion, preferably in Java?

Normally, Java 2 is a prerequisite for my Computer Architecture course. I gave permission to a strong student who has only taken Java 1 to take Computer Architecture, provided that she learn the ...
4
votes
4answers
514 views

Lambda expressions exercises and practice

While lambda expressions in java 8 are really cool in action, the school curriculum offers no exercises in this. So essentially, students never actually learn how to use lambda expressions and the ...
11
votes
3answers
321 views

Do Python and Java lead students to construct different mental models of memory?

How are novices' mental models of variable storage affected by programming language choices? Most Intro to CS teachers (I think) do not delve with breadth and depth into details of how variable names ...
15
votes
10answers
2k views

Explaining access levels and visibility in OOP

While teaching OOP in a high school CS major (in java), it is important (and part of the curriculum in any case) to explain "what is the meaning of this public and <...
4
votes
2answers
207 views

Introducing the MVC pattern along with JavaFX

This year I am planning to shift from teaching Swing for graphics, to teaching JavaFX. As JavaFX ideally uses the MVC design pattern, I thought it would help students understand how to use JavaFX if ...
7
votes
7answers
320 views

Explaining how an Interface is a contract

When teaching Interfaces (in Java, for example), it is common to describe them as a contract. Which means that if a class implements an interface, it has to use the methods in the interface. As an ...
8
votes
6answers
358 views

Analogy for abstract classes

Abstract classes are peculiar things. Consider: ...
3
votes
2answers
93 views

Genetic Algorithm enrichment lesson

As a special lesson, I would like to show students the very basic idea of genetic\evolutionary algorithms. I let them play a bit in a genetic algorithm online game, to get the idea. Then I teach them ...
4
votes
2answers
65 views

Teaching coding paradigms and concepts with specific context

Teaching programming is a great part of mentoring FRC (FIRST Robotics Competition) teams. For teaching how to program a robot (Specifically, a RoboRIO), I first (unintended pun: FIRST) need to teach ...
4
votes
2answers
147 views

Most beneficial CodingBat problems for AP CS A FRQs

I love the CodingBat platform and plan to integrate it throughout my course next year. Yet, since it will be my first year with AP CS A and I have not yet had a chance to study past years' FRQs, I'm ...
7
votes
3answers
147 views

What are good sample programs for learning to use a debugger?

One skill I teach students in Java 1 is how to use a debugger, specifically: single-stepping through code using breakpoints viewing the values of variables going up and down the call stack I have ...
11
votes
7answers
152 views

How to illustrate scope problem when creating variables inside `if` statements in Java

One of the problems that my students will stumble upon every year is trying to create or initialize variables within an if/else ...
8
votes
3answers
141 views

Workflow for Code Submission

Next year will be my first year teaching AP CS A. While I've spent a lot of time preparing by choosing textbooks, picking an IDE, and writing the syllabus, I'm not yet settled on my workflow for how ...
9
votes
7answers
301 views

Analogy for static objects (or members)

I'm trying to think of an analogy to explain how static members, references and objects work. What I have in mind is saying that static is like the number of computers in the world. That parameter ...
7
votes
3answers
344 views

Command-line Java in AP CS A

Context: Over the past school year I spent a significant portion of my time preparing to teach AP CS A next year. From choosing textbooks to writing the College Board syllabus, I essentially started ...
19
votes
7answers
1k views

What autograding software do folks use for Java code?

Grading currently either takes me a huge amount of time, or gets done in an extremely cursory way. It occurs to me that, if my students were able to submit code into some sort of autotester, they ...