Skip to main content

Posts

Showing posts with the label theory_part

Java Program using constructors

Simple Java Program using constructors. Here the constructor is “Cars”. //constructors public class Cars                 {                 public Cars(String name)                                 {                                 System.out.println("super "+name);                                 }               ...

Java: Another Simple Example of Displaying a Text

This is a simple Java program to display a text: This program enable you to understand: How to declare variable. Structure. Output statement. public class BeingAwesome                 {                 public static void main(String []args)                                 {                                 System.out.println("*****#####*****===+++@@@@&^%$#@!+_)(*&{}|");                           ...

The Simplest Java Program! - Displaying a Text

This is a simple Java program to display a text: 'i=100'. This program enable you to understand: How to declare variable. Structure. Output statement. class Awesome {                 static int i;                 public static void main(String[] args)                 {                                 i=100;                                 System.out.println("i="+i);                 } } Cl...

Procedure for testing your JDK Installation

Test Your JDK Open Command Prompt, type ‘ java ’ – enter. à If it is working, do the following tip. Try this program: Open Notepad and type the following codes: class Awe {                 public static void main(String []args)                 {                                 System.out.println(“wow! It’s working..!”);                 } } Save the file as “ Awe.java ”. Open Command Prompt and set the corresponding file address. Type ‘ javac Awe.java ’ –enter. (Now the code is compiled) Type ‘ java Awe ’ –enter. (Now the program is executed) If you are getting an ...

Procedure to install the Java Development Kit (JDK)

Simple Easy Steps for Installation of JDK Download JDK (latest version recommended) from  http://www.oracle.com/technetwork/java/javase/downloads/index.html  . Install it. Go to control panel . Then move to “ Control Panel\System and Security\System ”. Click “ Advanced System Settings ” in the margin. In the “ Advanced ” tab, click “ Environment variables ” button. Then in “ system variables ” area, select “ path ” and click “ edit ”. (Use with care)  (Windows 10 has a different interface, but similar). Separate the current content with a “ ; ” and include just right after that, the file address of the ‘ bin ’ file in java folder. See the example:  [Example: ….; C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Windows Live\Shared; C:\Program Files\Java\jdk1.7.0_45\bin; ] Then ‘OK’.

The Language Evaluation Criteria

There are a vast amount of programming language that we are using. Some are designed to accomplish some specific task. Some are for common uses. Any way the below described is a short ‘summery’ of the criteria we followed to evaluate the language. Overview 1.        Readability a.        Overall Simplicity b.       Orthogonality c.        Data Types d.       Syntax Design 2.        Writability a.        Simplicity and Orthogonality b.       Support for Abstraction c.        Expressivity 3.        Reliability a.        Type Checking b.       Exception Handling c.        Aliasing d.       Readability ...

Object Oriented Programming (OOPs)- a funny starting

OOPs – Object Oriented Programming System Object-oriented programming (OOP) is a programming paradigm that uses “Objects “and their interactions to design applications and computer programs. There are different types of OOPs are used, they are Object Class Data Abstraction & Encapsulation Inheritance Polymorphism Dynamic Binding Message Passing 1) Object : Object is the basic unit of object-oriented programming. Objects are identified by its unique name. An object represents a particular instance of a class. There can be more than one instance of an object. Each instance of an object can hold its own relevant data. An Object is a collection of data members and associated member functions also known as methods. For example whenever a class name is created according to the class an object should be created without creating object can’t able to use class. The class of Dog defines all possible dogs by listing the characteristics and behaviors they can have; the object Lassie is one pa...

Enumerated Datatypes AND #define

Ooops..! yes, this is an another post related to OOP. I feel this is some thing nice. There are situations where we want to introduce new data variables. That's why enumerated data types are used. haha, but this is not like u expect! Enumerated Datatypes These are user defined datatypes the key-word enum  is used syntax is enum var_name{var1,vae2,...,varn}; what happens is : var1=0, var2=1, var3=2, var4=3,... try the prog. below in ur cpp compiler. #define #define key-word is used. Eg: #define x value No ";" is used advantage: for a large program, if we want to alter a constant that is repeatedly used throughout the programme. meaning x can be used insted of value. For the perfect understanding, please work on the example below. (Shhhh... it is very simple!) _____________________________________________ // using enumerated data types, #define #include<conio.h> #include<iostream.h> #define num 60 #define name 0 void main() { clrscr(); enum b{q,w,e}; cout<...