Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial

Coding with John September 11, 2023
Video Thumbnail
Coding with John Logo

Coding with John

@codingwithjohn

About

Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners. Learn or improve your Java by watching it being coded live!

Video Description

Struggling with static vs nonstatic in Java? You found the perfect video! ☕ Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners For beginner Java programmers, the concept of static vs nonstatic fields and methods can be incredibly confusing. I know it was for me! But it doesn't have to be difficult. We'll go over EXACTLY what the difference is, how they're used, and when you should make your methods and fields static or nonstatic in your programs. Learn or improve your Java by watching it being coded live! Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners. Let me know what else you'd like to see! Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission. 📕 THE best book to learn Java, Effective Java by Joshua Bloch https://amzn.to/36AfdUu 📕 One of my favorite programming books, Clean Code by Robert Martin https://amzn.to/3GTPVhf 🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial http://www.audibletrial.com/johncleancode 🖥️Standing desk brand I use for recording (get a code for $30 off through this link!) https://bit.ly/3QPNGko 📹Camera I use for recording: https://amzn.to/3wlXcmR 🎙️Microphone I use (classy, I know): https://amzn.to/3AYGdbz Donate with PayPal (Thank you so much!) https://www.paypal.com/donate/?hosted_button_id=3VWCJJRHP4WL2 00:00 What Non-Static means 03:34 What Static means 05:53 Why can't I access my Non-Static variable? 08:42 Using Static for Constants 10:30 When to make something Static or Non-Static? ☕Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners https://codingwithjohn.com

You May Also Like

Java Developer Starter Pack

AI-recommended products based on this video

Loading...
Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

(0)
$29.99
$6.99 delivery Dec 23, 2025 - Jan 2, 2026
700+ bought in past month
Loading...
LEGO Speed Champions Oracle Red Bull Racing RB20 F1 Race Car Model Kits - Building Set for Adults, Ages 18+ with Realistic Features - Red Bull F1 DIY Crafts for Display - Gift Idea for F1 Fans - 77243

LEGO Speed Champions Oracle Red Bull Racing RB20 F1 Race Car Model Kits - Building Set for Adults, Ages 18+ with Realistic Features - Red Bull F1 DIY Crafts for Display - Gift Idea for F1 Fans - 77243

(353)
$29.98$29.53
FREE delivery Sat, Jun 14 on your first order
1K+ bought in past month
Loading...
Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous, Compatible with PC, Mac, Laptop - Black

Logitech M185 Wireless Mouse, 2.4GHz with USB Mini Receiver, 12-Month Battery Life, 1000 DPI Optical Tracking, Ambidextrous, Compatible with PC, Mac, Laptop - Black

(48,912)
$15.99$12.79
FREE delivery Wed, Feb 18 on your first order
1K+ bought in past month
Loading...
Logitech G305 Lightspeed Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

Logitech G305 Lightspeed Wireless Gaming Mouse, Hero 12K Sensor, 12,000 DPI, Lightweight, 6 Programmable Buttons, 250h Battery Life, On-Board Memory, PC/Mac - Black

(35,879)
$49.99$44.99
FREE delivery Mon, Jan 26
1K+ bought in past month
Loading...
Logitech K400 Plus Wireless Touch TV Keyboard With Easy Media Control and Built-in Touchpad, HTPC Keyboard for PC-connected TV, Windows, Android, Chrome OS, Laptop, Tablet - Black
Best Seller

Logitech K400 Plus Wireless Touch TV Keyboard With Easy Media Control and Built-in Touchpad, HTPC Keyboard for PC-connected TV, Windows, Android, Chrome OS, Laptop, Tablet - Black

(38,516)
$39.98$35.98
FREE delivery Thu, Sep 4
500+ bought in past month
Loading...
Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black
Best Seller

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

(17,871)
$27.98$22.38
FREE delivery Tue, Oct 14 on your first order
500+ bought in past month
Loading...
Dell UltraSharp U2723QE 27" 4K UHD WLED LCD Monitor - 16:9 - Black, Silver EPEAT

Dell UltraSharp U2723QE 27" 4K UHD WLED LCD Monitor - 16:9 - Black, Silver EPEAT

(13)
$699.99$650.99
FREE delivery Tue, Oct 7
50+ bought in past month
Loading...
Dell UltraSharp 24 Monitor - U2424H

Dell UltraSharp 24 Monitor - U2424H

(43)
$309.44$262.14
FREE delivery Aug 22 - 25Only 8 left in stock.
Loading...
Dell UltraSharp U2725QE 27' 4K Thunderbolt-Hub-Monitor mit Bildwiederholfrequenz Von 120Hz

Dell UltraSharp U2725QE 27' 4K Thunderbolt-Hub-Monitor mit Bildwiederholfrequenz Von 120Hz

(50)
$1,059.91
FREE delivery Oct 7 - 8
Loading...
Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified

Anker USB C Charger Cable (6ft 100W, 2Pack), USB 2.0 Type C Fast Charging Cable for iPhone 15 / 15Pro / 15Plus / 15ProMax MacBook Pro 2020, iPad Pro 2020, iPad Air 4, Samsung Galaxy S23+/S23 Ultra ClimatePartner certified

(44,904)
$17.99
FREE delivery Wed, Aug 20 on your first order
6K+ bought in past month
Loading...
Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

Anker USB C Cable, [2-Pack, 6 ft] Type C Charger Premium Nylon USB Cable, USB A to Type C Charging Cable Fast Charge for Samsung Galaxy S10 S10+ / Note 8, LG V20 and Other USB C Charger (Black)

(103,365)
$13.49
5K+ bought in past month
Loading...
Anker Nano USB C Wall Charger,45W Fast Charging Smart Display Charger,with 180°Foldable Plug,Smart Recognition,Built-in Care Mode,for iPhone17/16/15 (Non-Battery,One USB-C Port,No Cable Included) ClimatePartner certified

Anker Nano USB C Wall Charger,45W Fast Charging Smart Display Charger,with 180°Foldable Plug,Smart Recognition,Built-in Care Mode,for iPhone17/16/15 (Non-Battery,One USB-C Port,No Cable Included) ClimatePartner certified

(698)
$39.99
FREE delivery Wed, Mar 4
1K+ bought in past month
Loading...
SUPWEE 3D Nail Sculpting Gel Solid Builder Gel for Nails Art, Non-Sticky Hand Hard Gels for Extension Moding Carving DIY at Home 14g(0.49fl oz)

SUPWEE 3D Nail Sculpting Gel Solid Builder Gel for Nails Art, Non-Sticky Hand Hard Gels for Extension Moding Carving DIY at Home 14g(0.49fl oz)

(765)
$11.39
200+ bought in past month
Loading...
Publication Manual (OFFICIAL) of the American Psychological Association

Publication Manual (OFFICIAL) of the American Psychological Association

(31,759)
$42.70$32.84
FREE delivery Mon, Sep 15
Loading...
2025 New Screw-Top Lemon Squeezer,Fast Juicing, Portable Manual Citrus Juicer, Orange Extractor with Lid, Squeeze Lime for Cocktails, Drinks (yellow and green)

2025 New Screw-Top Lemon Squeezer,Fast Juicing, Portable Manual Citrus Juicer, Orange Extractor with Lid, Squeeze Lime for Cocktails, Drinks (yellow and green)

(0)
$9.38$7.91
FREE delivery Jun 23 - 27
50+ bought in past month