Find the best tutors and institutes for Java Training
Search for topics
Lesson Posted on 30/12/2020 IT Courses/Java IT Courses/Java/Core Java Tuition/BCA Tuition/Java Programming
Java : Compile-time Versus Runtime optimization
Surinder Pal Singh
I have 10 years of experience, working with Top IT companies. During my work it have extensively used...
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below :
What is the difference between line 1 & line 2 in the following code snippet?
public class CompileAndRuntimeTest{
static final int number1 = 5;
static final int number2 = 6;
static int number3 = 5;
static int number4= 6;
public static void main(String[ ] args) {
int product1 = number1 * number2; //line 1
int product2 = number3 * number4; //line 2
}
}
Line 1, evaluates the product at compile-time, and Line 2 evaluates the product at runtime. If you use a Java Decompiler (e.g. jd-gui), and decompile the compiled CompileAndRuntimeTest.class file, you will see why , as shown below:
public class CompileAndRuntimeTest
{
static final int number1 = 5;
static final int number2 = 6;
static int number3 = 5;
static int number4 = 6;
public static void main(String[ ] args)
{
int product1 = 30;//line 1 ---Here is the diff. Decompiled code
int product2 = number3 * number4; //line 2
}
}
Constant folding is an optimization technique used by the Java compiler. Since final variables cannot change, they can be optimized. Java Decompiler and javap command are handy tool for inspecting the compiled (i.e. byte code ) code.
Question for readers :) :
Can you think of scenarios other than code optimization, where inspecting a compiled code is useful?
read less
Lesson Posted on 04/08/2020 IT Courses/Programming Languages/Python IT Courses/Programming Languages/Python/Python Classes IT Courses/Programming Languages/Python/Python Beginner
Write your first Python program in 10 minutes
Debrati Sadhu
I teach Pre-primary (Nursery, KG) and Primary (I - V) students. I have Industry Experience trainer...
1. Download python from python official site search "python download" in google
2. Install in your machine
3. verify using : "python --version" command
4. Write first program using notepad
create a file named test.py and write the first line "print("Hello World");"
Save it.
5. Run : python test.py
Code Examples:
read less
Lesson Posted on 19/05/2020 Tuition/BTech Tuition IT Courses/Java
Swati S.
Can teach you programming in C,DataStructures,Algorithms ,Computer Networks,Operating System,Database...
When a class contains more than one method with the same method name but different argument types, then it is called Overloading.
Methods are said to be Overloaded methods.
Also, know as Compile time binding or Early binding.
The compiler takes care of overloaded methods and decides according to the signature which way is to be invoked.
Eg: class Display
{
public void show( int b) //1
{System.out.println(b);}
public void show(String s) //2
{System.out.println(s);}
public static void main(String args[ ])
{
Display d = new Display();
d.show(2);//1 method invoked
d.show("Swati");//2 method invoked
d.show( 10.5f)/*in 3 invocation
1 method gets invoked though show(float ) not present*/
}
}
1 &2 are overloaded methods in class Display.During a method call compiler first searches for exactly matched method calls in class.3 invocation compiler actually searches for show(float f) but it is not found.So it again searches for the method having argument that can be promoted into float and encounters 1 method.As we all know int can be converted into float.This is called Automatic argument promotion.
Output of program
2
Swati
10.5
read lessLooking for Java Training Classes
Find best Java Training Classes in your locality on UrbanPro.
Answered on 08/10/2020 IT Courses/Java IT Courses/Java Script Training Tuition/BCA Tuition/Java Programming
Palamala L Sai Nikitha
Answered on 07 Jan IT Courses/Java IT Courses/Java Script Training Tuition/BCA Tuition/Java Programming
Jyotsna Zutshi
FAITH IS THE ABILITY TO SEE THE INVISIBLE
Answered on 10/03/2020 IT Courses/Programming Languages/Python IT Courses/Java IT Courses/Programming Languages/PHP
Charlie
Both the development programs come with their strong suits. While Java allows you to enjoy the cross-platform support, Python helps you execute on at least ten different operating systems. It would help if you determined as to what the end goal os before deciding on which program you are going to use. Java for a beginner is not suitable, whereas, Python is ore forgiving as you have the liberty to take shortcuts. Additionally, many users find Python more easier to read and understand than Java. At the same time, Java code can be written once and executed from anywhere.
So choose wisely
read lessAnswered on 28/03/2020 IT Courses/Java/Core Java IT Courses/SAP/SAP Technology Platform /SAP ABAP
Need Career Counselling - please let me know your comments
Dear ALL,
Myself Sanjay Manoj completed Post graduation M.Sc Computer Science- May 2009 -7.5 CGPa
Jan 2009 - May 2009 ( ERP Support - Textile Industry ) Domain : Java Platform + SQL
From May 2009 to Mar 2010 ( worked in marketing)
April 2010 - May 2011 ( ERP + Production Follow up - Textile Industry ) - Java + Sql ( Textile company )
August 2011 - Feb 2014 ( Software Support - Shipping & Logistics industry) - .Net + Sql
Feb 2014 - dec 2016 ( Supply chain - ERP Support - Textile Apparel industry) - sybase + .Net + Sql
Jan 2017 - till now ( ERP Support + Production Follow up - Textile industry) - Java + Sql ( Textile company)
Now I dont know where should i go..
Technically i have zero knowledge.. but I want to go to Pure IT - Technical jobs..
Can i start to learn SAP ABAB - or any DB
I want to go into development for long race. ( I know IT is not a Long Race)
But Somehow I am struggling to get know my career path.. I Presume companies couldnt consider support persons whose age crossed 30..
What Should I do..
now I start to learn Core Java for time being.
After that SAP ABAP?
is this the good way? ...will my experience counts?
regards
Sanjay
read less
Rohinidevi
Six years experience in mathematics subject for b.Tech ,intermediate,degree and statistics students
Answered on 01/11/2020 IT Courses/Java
Vidhya.r
Answered on 15/06/2020 IT Courses/Java
Tamilarasi
Looking for Java Training Classes
Find best Java Training Classes in your locality on UrbanPro.
Answered on 23/01/2016 IT Courses/Java
Delhi Career Group Institute
UrbanPro.com helps you to connect with the best Java Training Classes in India. Post Your Requirement today and get connected.
Ask a Question
Find best tutors for Java Training Classes by posting a requirement.
Find best Java Training Classes in your locality on UrbanPro
Post your learning requirement