CMSC 131 Lecture Notes - Lecture 2: Java Syntax, Dollar Sign

77 views5 pages

Document Summary

You can"t learn a programming language without learning how it operates so here"s the syntax of java without further ado! Object- an object is a manifestation of the thing you want to control. For example a dog has the state of being alive or dead, happy or sad, color, breed, name. It also has actions such as barking, wagging its tail and eating. Class- a class is best described as a template for an object. Mammal of which the object dog is a part of share a common attribute. They all give milk to their young for example. You write logic in the methods and execute actions in the method. Instance variables- each object has its own set of instance variables. The values assigned to these instance variables make up the object"s state. public class myfirstjavaprogram { * this will print "hello world" as the output public static void main(string []args) {

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions