ebook img

Java PDF

210 Pages·2017·1.154 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Java

Copyright © 2017 by Mr Kotiyana All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. Table of Contents 1) Introduction Basic 4 1.1 What This Book Is About? 5 1.2 Why Read This Book? 6 1.3 Do I Need to Know Math? 8 1.4 Programming as a Form of Expression 9 2) Programming Basics 10 2.1 What is Programming? 11 2.2 What is Data? 12 2.3 Understanding Variables. 14 2.4 Naming Variables. 15 2.5 Keywords 20 2.6 Tokens 21 2.6.1 Writing Java 22 2.6.2 Separator Tokens 24 2.6.3 Operator Tokens 26 2.6.4 Literals 27 2.7 What are Functions? 28 2.7.1 Parameter Lists 33 2.7.2 Side Effects 34 2.7.3 Multiple Arguments 36 2.8 Logic and Operators 37 2.9 Return Keyword 41 2.10 Class/Static Variables 43 2.11 Arrays 44 2.12 Loops 51 2.13 Classes 63 2.14 Introduction to Objects 65 2.14.1 Characteristics of OOP 68 2.14.2 An object has an interface 70 2.14.3 An object provides services 73 2.14.4 The hidden implementation 75 2.14.5 Reusing the implementation 77 2.14.6 Inheritance 78 2.14.7 Polymorphism 83 2.15 Types 86 2.15.1 Value and Reference Types 87 2.15.2 Strong Typing 89 2.16 Thinking in Algorithms. 90 2.17 Statements and Expression. 96 2.18 Learning to copy & paste code. 99 2.19 Understanding floating points. 101 2.20 The Big O Notation. 102 3) Data Structures 110 3.1 Binary Search. 111 3.2 Bubble Sort 118 3.3 Insertion Sort 121 3.4 Merge Sort. 123 3.5 Quick Sort. 127 3.6 Selection Sort 132 3.7 Linked List 135 4 ) Network Programming 150 4.1 What is network programming 151 4.2 Socket Programming 152 4.3 URL Processing 163 5) Tips and Advice 5.1 Skills self-taught programmers commonly lack. 171 5.2 Important data structure and algorithms 175 5.3 9 ways to become Great Programmer. 178 5.4 4 Secrets of Great Programmers. 192 5.5 Difference between a programmers, a good Programmer and a great programmer. . 194 6) 4 Reasons why Your Program Crashes 195 7) Programming Quotes! 197 CHAPTER 1 | Introduction What This Book Is About This book was written as an answer for anyone to pick up a programming language and be productive. You will be able to start from scratch without having any previous exposure to any programming language. By the end of this book, you will have the skills to be a capable programmer, or at least know what is involved with how to read and write code. Afterward you should be armed with the knowledge required to feel confident in learning more. You should have general computer skills before you get started. After this you’ll know what it takes to at least look at code without your head spinning. Why Read This Book? You could go online and find videos and tutorials to learn; however, there is a distinct disadvantage when it comes to learning things in order and in one place. Most YouTube or tutorial websites either gloss over a topic or dwell at a turtle’s pace for an hour on a particular subject. Online content is often brief and doesn’t go into much depth on any given topic. It is incomplete or still a work in progress. You’ll often find yourself waiting weeks for another video or tutorial to come out. Most online tutorials for Java are scattered, disordered, and incohesive. It is difficult to find a good starting point and even more difficult to find a continuous list of tutorials to bring you to any clear understanding of the Java programming language. Just so you know, you should find the act of learning exciting. If not, then you’ll have a hard time continuing through to the end of this book. To learn any new skill, a lot of patience is required. I remember asking an expert programmer how I’d learn to program. He told me to write a compiler. At that time, it seemed rather mean, but now I understand why he said that. It is like telling someone who wants to learn how to drive Formula 1 cars to go compete in a race. In both cases, the “learn” part was left out of the process of learning. It is very difficult to tell someone who wants to learn to write code where to begin. However, it all really does start with your preparedness to learn. Your motivation must extend beyond the content of this book. You may also have some preconceived notions about what a programming is. I can’t change that, but you should be willing to change your thoughts on the topic if you make discoveries contrary to your knowledge. Keep an open mind. Computer artists often believe that programming is a technical subject that is incompatible with art. I find the contrary to be true. Programming is an art, much as literature and design is an art. Programming just has a lot of obscure rules that need to be understood for anything to work. Do I Need to Know Math? With complex rules in mind, does programming require the knowledge of complex mathematics? Actually, unless you program mathematical software, only a bit of geometry is nice to have. Most of the examples here use only a tiny bit of math to accomplish their purposes. Mathematics and programming do overlap quite a lot in their methodology. Math taught in schools provides a single solution. Programming results tend to behave a bit like a math proof, but only the proof isn’t just another bit of math. Rather, the proof of your code means that your zombies chase after humans. A considerable amount of math required has been done for you by the computer. It is just up to you to know what math to use, and then plug in the right variables. Programming as a Form of Expression There is a deeper connection between words and meaning in programming. This connection is more mechanical, but flexible at the same time. In relation to a programming language, programmers like to call this “expressiveness.” When you write words in literature, you infer most if not all of the meaning. When programming inference isn’t implied, then you’re free to define your own meanings for words and invent words freely. One common merging of art and code appears within a video game. Anytime characters can react to each other and react to user interaction, which conveys a greater experience. An artist, an animator, or an environment designer should have some ability to convey a richer experience to the audience. A character artist can show a monster to his or her audience; but to really experience the creature, the monster should glare, grunt, and attack in reaction to the audience.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.