Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to create object in JAVA

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-10-2009
Member
 
Join Date: Feb 2009
Posts: 61
How to create object in JAVA
  

Hi,
I need some information how to create object in a JAVA program. I am newbie in it. Also need some information on Java Expression. What does it means and how to use it. I had completed half of it. I had done with objects, Variables and Data Types and Java Operators. Now I had some project work to finish it up. So please post some appropriate suggestions. Thanks in advance.

Reply With Quote
  #2  
Old 09-10-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: How to create object in JAVA

A expressions is a element that do the work of a Java program. Among other things, expressions are used to calculate and assign values to variables and to control the flow of a Java program. The work of an expression is divided into two parts, the calculations indicated by the elements of expression and return some value. It is actually a set of variables, operators, and method calls (constructed according to the syntax of language) that evaluates to a single value. The type of data returned by an expression depends on the elements used in the expression. The expression count + + returns an integer because + + returns the same type as its operand and count is an integer. Other expressions return boolean values, strings, etc ...
Reply With Quote
  #3  
Old 09-10-2009
Member
 
Join Date: May 2008
Posts: 2,380
Re: How to create object in JAVA

An expression of a method call returns the value of the method and the data type of an expression of a method call is the same type of data that the method return value. The method System.in.read () was declared as an integer, hence the expression System.in.read () returns an integer. The second expression in the sentence System.in.read ()! = -1 Using the! =. Remember that this operator checks if the two operands are different. In this sentence the operands are System.in.read () and -1. As you can see, Java allows you to build compound expressions and statements from several small expressions provided that the data types required by a part of the expression matches the data types of the other. There will also be able to complete the above example, the order in which they evaluated the components of a compound expression.
Reply With Quote
  #4  
Old 09-10-2009
Member
 
Join Date: Feb 2008
Posts: 1,845
Re: How to create object in JAVA

Here are some useful tips to generate a object in JAVA. First to you have to create Objects in Java. In Java, an object is created by creating an object of a class or, in other words, instantiating a class. Learn how to create a class later in Creating Classes. The new operator instantiates a class by allocating memory for the new object of that type. New needs a single argument: a call to the constructor. Constructor methods are special methods provided by each Java class that are causing these initialization of new objects of that type. The new operator creates the object, the constructor initializes.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create object in JAVA"
Thread Thread Starter Forum Replies Last Post
get classes and object in java preeti makkar Software Development 1 07-05-2012 11:08 AM
How to create an Object in Arrays? sRIPRIYA Software Development 4 13-12-2010 11:59 PM
Adding an object in java Gunner 1 Software Development 5 27-02-2010 02:20 AM
How big is an Object in Java? Why Java neglects sizeof? KALINDA Software Development 4 10-11-2009 02:19 AM
Object test = new Object() <-- Java, best way in C++ ADISH Software Development 3 25-10-2008 02:32 PM


All times are GMT +5.5. The time now is 05:08 AM.