New Tutorials:   KOTLIN    JAVASCRIPT    SASS/SCSS    PL/SQL  

Abhishek Ahlawat iamabhishek Author

A life of leisure and a life of laziness are two things. There will be sleeping enough in the grave. Founder @ Studytonight

     

iamabhishek's Answers


iamabhishek

iamabhishek

Is this a question? Do you want to learn how to design a basic webpage with Sidebar, Header and Main body section. This will help you: https://www.studytonight.com/code/web-beginner-exercise-III/#/1

Q :  Multi div

2 years ago

iamabhishek

iamabhishek

There are 6 directives in C language for Conditional Compilation: #if, #ifdef, #ifndef, #else, #elif, #endif, and defined

It's more or less just like conditional statements that we use, like if-else, switch statements etc. The only difference being that in case of conditional compilation this is done using directives.

Here is a simple example:

#include <stdio.h>
#define x 10
int main()
{
#ifdef x
printf("hello\n"); // this is compiled as x is defined
#else
printf("bye\n"); // this isn't compiled
#endif
return 0;
}

Q :  What is conditional compilation?

3 years ago

iamabhishek

iamabhishek

Right. In pre-emptive scenario, if some process comes up which is considered more important, either based on priority or any other thing, the existing process is put on hold to provide resources for the important process.

While in Non Pre-emptive, no such thing happens.

By the way, were you asking the question or telling, because your description holds the answer to your question.

Q :  Difference between primitive and non primitive

3 years ago

iamabhishek

iamabhishek

As per your question:
Customer table = cust_name, street, city
Account table = account_no, branch_name, balance
Branch table = branch_name, city, assets
Borrow table = loan_no, branch_name, amount

For what I see, how is the Account related to Customer? There should be some relationship there, the Account table should have customer information too so that we know which customer's account that is?

Have you specified the problem correctly?

Q :  Solve the query.

3 years ago

iamabhishek

iamabhishek

What error are you getting? Please share the error.

Q :  How to make multiple source file in a single empty project on visual studio?

3 years ago

iamabhishek

iamabhishek

Hey, are you talking about this test: https://www.studytonight.com/c/tests/4

The answers are visible. Please try again. If its some other test that you are talking about, please share the link.

Q :  Why are the answers for C Programming MCQ test 4 not available

3 years ago

iamabhishek

iamabhishek

// is used to add a single line comment

whereas /* */ is used to add multiple lines of comment, for example:

/* This is a 
multiple line
comment */

Q :  What's the difference between // and /* */ use in c or c++ program.

3 years ago

iamabhishek

iamabhishek

You can declare a variable inside the loop, but then the variable won't be available outside the scope of the loop.

Q :  Can a data type gets declared inside a loop in C language .

3 years ago

iamabhishek

iamabhishek

Here is binary search in Javascript, try to convert this into Java and C++. If we do the whole thing, you won't learn anything ;)

/* Returns either the index of the location in the array,
or -1 if the array did not contain the targetValue */
var doSearch = function(array, targetValue) {
var min = 0;
var max = array.length - 1;
var guess;
var count = 0;
while(max >= min) {
guess = Math.floor((max+min)/2);
// count tells at the end, that in how many guesses we found the target
count++;
println("Guess is: " + guess);
if(array[guess] === targetValue) {
println("Number of guesses:" + count);
return guess;
}
else if(array[guess] > targetValue) {
max = guess-1;
}
else
{ min = guess + 1; }
}
return -1;
};

var primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37,
41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97];

var result = doSearch(primes, 73);
println("Found prime at index " + result);

Q :  Write a Java (or C++) program to implement binary search.

3 years ago

iamabhishek

iamabhishek

i) if t(n) is O(n) means linear, in such a case time will increase linearly with input, hence if input becomes 4 times, so will the time, hence 40 seconds.

ii) t(n) is O(n4 + 3n - 253) - means O(n raised to the power 4) means time grows by raised to the power 4 with a value of n. Hence if the time for 300 is 10 seconds then, time for 1200 will be 2560 seconds.

iii) t(n) is O(log n) - Time is a logarithmic function. Then the number of steps or time required is always taken as power of 2, based on input, 2 raised to the power 9 is 512, which is closest to 300, hence 9+1 - 10 seconds (more like binary search, if 1 second is required to make 1 guess), hence for 1200, 2 raised to the power 11 is 2048 which is closest to 1200, hence (11+1) = 12 seconds should be the answer.

Hope the answers are correct. Do share the correct answers.

Q :  Assume that an algorithm takes about 10 seconds for an input size of 300. Let t(n) be the time for size n.

3 years ago

iamabhishek

iamabhishek

log(log n) - Fastest
√n - because this is n raised to the power 1/2
n(0.7), n, 2n, and 5n would be same as per Big O because Big O ignores constants, still if you want to order these, it will be n(0.7) -> n -> 2n -> 5n
and the slowest would be n!

Q :  Order the following from fast-to-slow using Big-Oh.

3 years ago

iamabhishek

iamabhishek

Permission to access actions. Because Authorisation is about checking whether a user has the authority to perform the action or not. The action here can be accessing data or performing some operation etc.

Q :  Authorization is about

3 years ago

iamabhishek

iamabhishek

A flowchart. Because a flowchart is a visual representation of the complete flow, while a pseudo code is a human readable form of the complete code flow.

Q :  Pseudo code can replace with

3 years ago

iamabhishek

iamabhishek

Hello Jauhar,
You can use a regular expression for this. The first thing that you should do is to list down all the prepositions and then scan the string to find out words before and after it.
To break down a sentence into a list of words, you can use the map() function in python.


# to break your sentence into words based on whitespaces
words = sentence.split()

Once you have the list of words, you can directly search for prepositions and then look for the words before and after it by doing (index of the preposition) - 1 and (index of the preposition) + 1

You can initially start by doing a simple search whether any preposition is present in the sentence or not.


import re

search_list = ['to', 'till', 'toward'...]
sentence = 'some long sentence with or without prepositions'
#re.IGNORECASE is used to ignore case
if re.compile('|'.join(search_list),re.IGNORECASE).search(sentence):
# Do a traversal to find for the prepositions
else:
# No prepositions present


Anyways I think in any case I do not think this can be done without a traversal because we need the index or position of the found preposition and then look for the element before and after it.

Q :  Python code to extract part of speech before and after preposition...

3 years ago

iamabhishek

iamabhishek

Please post complete problem with a detailed question and description, otherwise we will have to delete this question.

Q :  Static

3 years ago

iamabhishek

iamabhishek

Here, I wrote code in Python to help you with this:

Implementing Stack in Python: https://www.studytonight.com/code/python/algo/implementing-stack-in-python.php

Arithmetic Expression evaluation using Stack in Python: https://www.studytonight.com/code/python/algo/arithmetic-expression-evaluation-stack.php

Hope this helps you.

Q :  How can I use stacks in Arithmetic Operations?

3 years ago

iamabhishek

iamabhishek

If you can use third party jar files in your project, then use http://www.joda.org/joda-time/ - Joda Time Library.
Following will be the code using the above library:

LocalDate birthdate = new LocalDate (1970, 1, 20);          //Birth date
LocalDate now = new LocalDate(); //Today's date
Period period = new Period(birthdate, now, PeriodType.yearMonthDay());
//Now access the values as below
System.out.println(period.getDays());
System.out.println(period.getMonths());
System.out.println(period.getYears());


In Java 8, the Period class has been provided in Java, hence, if you are working on Java 8 (The code looks almost like above code, don't worry, it works)
LocalDate today = LocalDate.now();
LocalDate birthday = LocalDate.of(1960, Month.JANUARY, 1);

Period p = Period.between(birthday, today);

//Now access the values as below
System.out.println(period.getDays());
System.out.println(period.getMonths());
System.out.println(period.getYears());


For earlier versions of Java, and without any third party library, try this:
private String getAge(int year, int month, int day)
{
Calendar dob = Calendar.getInstance();
Calendar today = Calendar.getInstance();

dob.set(year, month, day);

int age = today.get(Calendar.YEAR) - dob.get(Calendar.YEAR);

if (today.get(Calendar.DAY_OF_YEAR) < dob.get(Calendar.DAY_OF_YEAR))
{
age--;
}
Integer ageInt = new Integer(age);
String ageS = ageInt.toString();
return ageS;
}

Q :  How do you calculate Age?

3 years ago

iamabhishek

iamabhishek

Great question, here is the Java code for it:

/* A Java program to evaluate a given expression where tokens are separated 
by space.
Test Cases:
"10 + 2 * 6" ---> 22
"100 * 2 + 12" ---> 212
"100 * ( 2 + 12 )" ---> 1400
"100 * ( 2 + 12 ) / 14" ---> 100
*/
import java.util.Stack;

public class EvaluateString
{
static boolean precedence(char x,char y)
{//System.out.println(x+" "+y);
if(x=='*'||x=='/'&&y=='+'||y=='-') return true;
return false;
}
static int calculate(char c,int a,int b)
{
if(c=='*') return a*b;
if(c=='/') return b/a;
if(c=='+') return a+b;
if(c=='-') return b-a;
return 0;}

static int evaluate(String st)
{
int l=st.length();
Stack<Integer> ns=new Stack<Integer>();
Stack<Character> op=new Stack<Character>();
int a=0;char ch;StringBuffer s;
while(a<l)
{ch=st.charAt(a);
if(ch==' '){a++;continue;}
if(ch<='9'&&ch>='0')
{a++;s=new StringBuffer();s.append(ch);
while(a<l&&st.charAt(a)<='9'&&st.charAt(a)>='0')
{s.append(st.charAt(a));a++;}
ns.push(Integer.parseInt(new String(s)));
continue;}
else if(ch=='(')
{
op.push('(');
}
else if(ch==')')
{
while(!op.empty()&&op.peek()!='(')
{
ns.push(calculate(op.pop(),ns.pop(),ns.pop()));
}
op.pop();
}
else
{
while(!op.empty()&&precedence(op.peek(),ch))
{
ns.push(calculate(op.pop(),ns.pop(),ns.pop()));
}op.push(ch);
}
a++;}
System.out.println(ns); System.out.println(op);
while(!op.empty())
{
ns.push(calculate(op.pop(),ns.pop(),ns.pop()));
}
return ns.pop();

}

// Driver method to test above methods
public static void main(String[] args)
{
System.out.println(EvaluateString.evaluate("10 + 2 * 6"));
System.out.println(EvaluateString.evaluate("100 * 2 + 12"));
System.out.println(EvaluateString.evaluate("100 * ( 2 + 12 )"));
System.out.println(EvaluateString.evaluate("100 * ( 2 + 12 ) / 14"));
}
}

Q :  How can I use stacks in Arithmetic Operations?

3 years ago

iamabhishek

iamabhishek

The question is easy but the language to describe the question is a little tricky.
So the question says, you have to write a program which will act as the Interviewer and should ask for inputs from the user(who will act as Interviewee).

Inputs to be taken: 4 questions that need String inputs, like What is your name, Your College name etc.
2 questions that need Integer inputs, like Your age or Your current CTC etc,
and one float input, like your CGPA(percentage) in college or school etc.

Now to take input all you have to do is, print what you want the user to tell and then use the Scanner class or the BufferedReader class to take user input.

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s = br.readLine();
int i = Integer.parseInt(br.readLine());


Another function that the question demands is that you perform some operation on one of the Integer input from the user like they have mentioned in example - Calculating Age from Date of Birth

So you will have to write a small function for that too, or you can think of some other Integer information that you can demand from the user and can perform any operation on it.

And in the program you write, you must include decision making(if-else statement) and looping(for loop or while loop)

So this is what the question demands.

Q :  This is a java task I was asked and all I can say is I am completely lost with many erros, if anyone can help me out pleasee.

3 years ago

iamabhishek

iamabhishek

On line number 4, I see variable c1 without a semicolon, is it a different line or part of the comment above it.

Same is the case with line number 11 where variable c2 is without semicolon. For multiline comment use /* comment here */

Q :  Hey guys! So I got this Java code and it seems to report an error of an ';' missing although it is present in the code, please help me out!...

3 years ago

iamabhishek

iamabhishek

Hello Ankit,

What difficulties are you facing in learning Java?

Q :  I found difficulties in learning codes.

3 years ago

iamabhishek

iamabhishek

Are you looking for the English meaning? You can easily Google it, still as you have posted this question here:

A pedestrian is a person traveling on foot, whether walking or running.

Q :  Who are known as a pedestrians

3 years ago

iamabhishek

iamabhishek

Hey Omer,

What is the way to fix it?

Doing a "Clean+Build" or "Rebuild" does not always fix it...as those operations do not delete the "tlog" files. So:

1. delete any "tlog" files that you can find in your solution/project directories and rebuild.

2. make sure your Project does not refer to non-existent files

How do I work out which files are non-existent?

If you want to know/find out exactly which files Visual Studio is thinking are out of date, then you can turn on some diagnostic information in Visual Studio....and watch the messages in DebugView...showing the full path of the files it is probing.

http://blogs.msdn.com/b/vsproject/archive/2009/07/21/enable-c-project-system-logging.aspx
In devenv.exe.config you put:

<system.diagnostics>
<switches>
<add name="CPS" value="4" />
</switches>
</system.diagnostics>


Detailed Answer here: https://stackoverflow.com/questions/14969138/visual-studio-project-out-of-date

Q :  I just mess with path of visual studio while saving project now whenever i am making any project and ................

3 years ago

iamabhishek

iamabhishek

Most issues are fixed now. Login and Signup are working again.

Q :  Please report any issue that you face on Studytonight

3 years ago

iamabhishek

iamabhishek

Casper recently reported that he was unable to access test for subjects other than Java. We have now fixed the issue.

Thank you Casper.

Q :  Please report any issue that you face on Studytonight

3 years ago

iamabhishek

iamabhishek

Hey Toofine, if I am getting you right, you want a C++ program to read a file with 5 pages, from start to end and end to start?
What do you mean when you say you want a Link? Please update.

Q :  Create a link that flip through the file of 5pages moving from previous page to next page and vice versa

3 years ago

iamabhishek

iamabhishek

Hey Sri,

I very good question indeed. We never focus on these things and just accept them as it is, without trying to know how they work. Well, I researched a little and found that it is a hardware aspect. I will write a detailed answer by tonight.

Q :  Multi core and Single core. Are these cores, software or hardware?

3 years ago

iamabhishek

iamabhishek

Because Java does not support Pointers.

Q :  Why not use pointer in the java langauge

3 years ago

iamabhishek

iamabhishek

Hey Ali,

Studytonight has recently started a video series for C Programming language. You must follow it to understand C language.
Here is the first video: https://www.youtube.com/watch?v=wi50EmE2DK8

Q :  Basic features of c

3 years ago

iamabhishek

iamabhishek

Hello,
A very good question, I will try to answer to the best of my knowledge.

1. Yes, A local variable is destroyed as the scope of the function ends because it is not known outside of the function. In your example, you create an Object, in which case the destructor will be called to destroy it, so you can override the destructor to perform some task, but the object will be destroyed. Although you can copy it to another variable object to store useful data.

2. For a static variable, the scope is until the end of complete execution. Yes, it will save its state until the end of the execution. It will not be erased at the end of any function as it is linked to the Class

3. It is not a good practice to use static variable because of its anti-OOP nature. Also, when you are not sure about the scope of a variable then it becomes difficult to test it.

Hope this answers your question, feel free to ask if there is anything that I missed or misunderstood.

Q :  Dynamic and static variable

3 years ago

iamabhishek

iamabhishek

Hello Rahul,

To style a paragraph tag, use the following code:

<p style="color:red;">Red Color Text</p>

or, you can add any other styling attribute, like background-color:yellow
To separate multiple styling attributes use semicolon(;)
<p style="color:red;background-color:yellow">Red Color Text</p>


Following links will help you:
http://www.studytonight.com/cascading-style-sheet/css-syntax
http://www.studytonight.com/cascading-style-sheet/css-selectors

To practice, checkout the following CSS examples:
http://www.studytonight.com/code/playground/examples/css.php

Q :  How to use in pragraph

3 years ago

iamabhishek

iamabhishek

You can use services like MSG91 to send OTP SMSs to any mobile number. If you only want to generate an OTP, then you can do that easily using the following function:

function randomIntFromInterval(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}

Where, min and max defines the range, for example if you want to send a 4 number OTP then, set min as 1000 and max as 9999

MSG91 provides with simple to use API along with code examples to send SMS. Also, if you are a Student or a Startup, they even offer free plans in exchange for having their logo on your website.

Q :  Sir,how can insert an OTP Program in html ?

3 years ago

iamabhishek

iamabhishek

Hi srikanth4109, this is a very good question.
In C language, if fork() is successful, then it creates two processes, both executing the main function from the point where fork has returned.
In the above program we have 3 fork() calls. Hence, after the 1st fork() call, 2 processes gets created, after the second fork() call, the each of the 2 processes are again doubled, hence 4 processes, and after the third consecutive fork() call, 8 processes are spawned all of which will be executing the main() function.

Hence, hello is printed 8 times.

Q :  Can any one explain the outcome of the code and how?

3 years ago

iamabhishek

iamabhishek

When we go to a shoe shop, to buy a pair of shoes, they pack the shoe in a shoe box so that it becomes easier for us to carry our new shoes back home.
Another example, We can walk, but when we have to travel a long distance we use car or motorcycles. A car can generally carry upto 5-8 people at one time, whereas a bus can carry upto 60 people at the same time. While in a train, where multiple carriages are linked together, they are able to carry 1000+ passengers.

Consider data as passengers or shoe, we need container/variables to hold our data, in a program. A variable can hold a single data, an array can hold similar type of data, then we have Linked List which can be infinite in size, you can just keep adding data to it. So all these are just different ways to store data to carry it efficiently around, and these are data structures.

So a Data Structure is nothing but a structure which is used to store and hold data.

Hope you understand :)

Q :  What is data structure

3 years ago

iamabhishek

iamabhishek

From what I understand from your question, I think you are talking about return statement at the end on the main() function

int main() {
// some statements
return 0;
}

As you can see here that the main() function is used with an int return type, hence C++ compiler expects a return statement, which is why we add the return statement. 0 traditionally indicates that the program was successful. Also, you don't have to return 0 explicitly, because that'll happen automatically when main terminates. But it's important to keep in mind that main is the only function where omitting return is allowed.

In C language void main() { ... } usage is also allowed where you do not have to add the return statement at the end.

Q :  Why return 0 used in c++ ......which role perform in c++

3 years ago

iamabhishek

iamabhishek

To kick off, let me share mine.

When in college, I never ever prepared for the Viva. My best friend's roll number was 2252 and mine was 2253 and both of us would simply sit quietly while watching here and there as the teacher asked questions.

There was this one time, where the teacher asked me to name all the subjects that we were studying in the current semester, I named them, but I didn't know full forms for many subjects at that time. For example, DS stands for Data Structures.

Q :  Share your Practical Viva experiences. Let's see who was the most badass student!

3 years ago

iamabhishek

iamabhishek

A virus in Computer world is nothing but a program or a script written in any programming language, which is meant to run on any computer/server/machine and perform any undesirable action for example: clean the Hard disk of the computer, or maybe share the entire data with someone online etc.

Generally virus scripts/programs are in .exe format or .bat for windows. If you receive any such file over email, it is advised to never execute it on your computer.

In simple words, just like a Dengue virus leads to decrease in patients platelet count when a Dengue mosquito bites you, similarly a computer virus infects the computer and can cause harm to its hardware or software or maybe both.

Q :  What is a Computer Virus?

3 years ago

iamabhishek

iamabhishek

Hello @rsire4444 currently there are no Python Tests, but there will be soon.

Q :  Why is the Python test nothing but Java questions

3 years ago

iamabhishek

iamabhishek

Once you are done with C language, you will have a good enough introduction of the programming world, and then it will be much easier for you to learn C++ although concept of Object-oriented programming will still be a new thing in C++ but again, it is not that difficult.
This tutorial here, is the best to understand OOP concept: http://www.studytonight.com/cpp/cpp-and-oops-concepts.php

Q :  How long is the C Tutorial and C++ Tutorial?

3 years ago

iamabhishek

iamabhishek

He is referring to the following program: http://www.studytonight.com/c/reverse-a-string-program.php

And I think that @nizam123 you are right. The program looks incorrect. It should be k = i

Q :  I want to ask about the c program written in ur website for reversing a string.

3 years ago

iamabhishek

iamabhishek

Hey buddy,
Here is the program to do that. And I am also adding a few links that will help you understand this better. Cheers mate, you will soon be an expert.


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char name[20];
clrscr();
printf("Enter your name:");
scanf("%[^\n]", &name);
printf("%s", name);
getch();
}


The links:
http://www.studytonight.com/c/c-input-output-function.php
http://www.studytonight.com/c/arrays-in-c.php
http://www.studytonight.com/c/string-and-character-array.php

Q :  Write a C code that prompt you to supply your name then display it on the screen?

3 years ago

iamabhishek

iamabhishek

Many new web based products of startups are in Java like OYO Rooms is built on Java, then there is Zomato. Also Nasa's https://worldwind.arc.nasa.gov/ is written in Java.
So yes, still people are using Java to build products, but we all have to accept the fact that now Java is not the only good option. Many new frameworks are getting developed in the app development sector, hence the diversity is growing.

Q :  What is Java based newest application?

3 years ago

iamabhishek

iamabhishek

Hello dadhu, which type of exam are you talking about? A Lab practical, or a Semester Exam or OCJP exam or a Job Interview, please specify, so that we can help you.

Q :  Which is the best solution to solve core java exams paper ..

3 years ago

iamabhishek

iamabhishek

My coding skills are Php, MySQL, jQuery, Python, Java and many Javascript frameworks.

Q :  What is your skill?

3 years ago

iamabhishek

iamabhishek

To create S3 client connection and upload files, first you must download the aws-sdk for php. Once you have the required packages and files, follow these steps.
1. Create a config.php file to store necessary credentials.

<?php
return [
's3' => [
'key' => 'YOUR_IAM_KEY',
'secret' => 'YOUR_IAM_SECRET_KEY',
'bucket' => 'BUCKET_NAME'
]
];
?>

2. Creating Connection to S3. Create a start.php file to setup connection with S3 and instantiate it.
<?php

use Aws\S3\S3Client;

require_once path-to/aws-autoloader.php';
$config = require('config.php');

// Creating S3 instance
$s3 = S3Client::factory([
'region' => 'ap-south-1',
'version' => '2006-03-01',
'credentials' => [
'key' => $config['s3']['key'],
'secret' => $config['s3']['secret']
]
]);
?>

3. And then, use the S3->putObject method to upload your files.
$s3->putObject([
'Bucket' => $config['s3']['bucket'],
'Key' => "curious/uploads/pictures/{$new_name}",
'SourceFile' => $tmp_file_path,
'ContentType' => $file['type'],
'ACL' => 'public-read'
]);

Q :  Please share how to upload file to S3 bucket with Php?

3 years ago

iamabhishek

iamabhishek

CPU scheduling is a process to keep the CPU busy with some sort of work all the time. A computer is assigned to work on multiple problems at the all time, CPU scheduling uses various algorithms to find which process is important and then executes it.
Circumstances can be when a high priority process arrives in the Queue, it may be sent to CPU for execution, this is a circumstance which led to CPU scheduling.

Follow this link: http://www.studytonight.com/operating-system/process-scheduling
This will help you in understanding the concept.

Q :  What are the circumstances in which cpu scheduling may take Place?

3 years ago

iamabhishek

iamabhishek

Are you using any UI framework, like Bootstrap? A Modal is a javascript component, and there is nothing that Php can do here. For what I understand, you want to show a modal, when a user successfully logs in. There are multiple ways to accomplish this:

1. If you are using jQuery or Javascript to validatr Login form then you can very easily inititate the modal using javascript.

2. If you are using default form submission using Php, then you can reload the page upon successful login and use $document.ready to fire modal as the new page loads.

Q :  Can i create call or echo a modal using php?

3 years ago

iamabhishek

iamabhishek

Hey prateek,

Just follow this simple tutorial: http://www.studytonight.com/c/loops-in-c.php

Q :  How to impliy looping in c program ?/

3 years ago

iamabhishek

iamabhishek

Hey Shree,
Great to see you out here, participating with the Studytonight Community. Kudos to you!
Do keep a watch on what students are asking about Game Development.

:)

Q :  What is the probability that Abhishek himself will answer this question?

3 years ago

iamabhishek

iamabhishek

Can you please share the error that you got.

Q :  How to deal with a 'nan' error?

3 years ago

iamabhishek

iamabhishek

Hello cherrymacharia, Data Mining and Data Warehousing is currently being published and will be available very soon.

Q :  Please available the other courses also like dmdw &aad like that

3 years ago

iamabhishek

iamabhishek

For any element in HTML, you can use the style attribute to add styling.


<div style="background-color:yellow;"> My Background is yellow </div>

Q :  How do change the color of the background

4 years ago

iamabhishek

iamabhishek

We are working on bringing in Video lessons :)

Q :  Isn't there any video lessons?

4 years ago

iamabhishek

iamabhishek

As you can see here : http://www.studytonight.com/data-structures/merge-sort

p is 0, to point it to the starting of array, such that a[p] will give the first element of array. r, is the last index of array.

q is, q = floor( (p+r) / 2); which means, q is the center point of the array. q + 1 signifies the first element of the second half of the array.

Q :  What does q +1 specify in a merge sort array?

4 years ago

iamabhishek

iamabhishek

Threads in Java can be created both by implementing the Runnable Interface or by extending the Thread class. Following are a few points, based on which you can decide which is best suited for you :
1. Extending Thread class will not allow us to extend any other class as Java does not support Multiple Inheritance.
2. Thread class does have its own functions and definitions and those will be included in your Thread subclass. This is an overhead. While Runnable Interface doesnt brings in any overhead.

This is a good discussion around the same thing : http://stackoverflow.com/questions/541487/implements-runnable-vs-extends-thread

And here is the tutorial to create threads in Java : http://www.studytonight.com/java/creating-a-thread.php

Q :  Which is the best way to create thread of the two ?

4 years ago

iamabhishek

iamabhishek

Is it the complete program? I dont think so. Please do check your questions before posting. And you should put the code in body of a question.

Q :  Public class MyClass { public static void main(String|| args) { B b = new C(); A a = b; if (a instanceof A) System.out.println("A"); if (a instanceof B) System.out.println("B"); i

4 years ago

iamabhishek

iamabhishek

Download the Android App for Studytonight from Google Play Store. You can download tutorials for offline access on the App.

Link : https://play.google.com/store/apps/details?id=com.studytonight.app

Q :  I Want offline download link for studytonight

4 years ago

iamabhishek

iamabhishek

When a sender sends data packets to a receiver over a network, it os done in continuous way. All the packets are sent with a fixed interval between everyones transmission. But due to improper queueing, network congestion, the packets are not always received with the same delay between them. Some arrives in order, some arrives after an abrupt delay. This is called jitters.
For example when we stream Youtube video, once the video starts playing it should keep on playing without buffering, because the video packets have started reaching us, but due to poor network, some packets arrive after a delay leading to video buffering.
In an ideal network condition, once we start receiving packets of data, we must receive all of them in a queue, with equal time separation between all.

Q :  What are the causes of Jitter ? Using example

4 years ago

iamabhishek

iamabhishek

ray in C Language? Are you sure you are asking the right question?

Q :  What is the use of ray

4 years ago

iamabhishek

iamabhishek

The compiled files are found in /work folder of the Tomcat directory.

It should be something like :

Tomcat > work > Catalina > localhost > projectname > ... > jsp > Here you will find .java and .class files 


Tomcat has folders like /bin, /conf, /lib, /logs, /webapps and /work etc

Do let me know if you face any issue.

Q :  Where are the ".java" and ".class" stored after the JSP page is converted ?

4 years ago

iamabhishek

iamabhishek

If you are on Oracle, follow the following steps:

1. Connect to Oracle database:

sqlplus username/[email protected]

2. To list all tables owned by the current user:
select tablespace_name, table_name from user_tables;

3. To list all tables in a database:
select tablespace_name, table_name from dba_tables;

Hope this helps. Do post if you face any problem.

Q :  In dbms how to find how get tables i have created??

4 years ago

iamabhishek

iamabhishek

If you are using MySql and have access to PhpMyAdmin tool, you can directly access all your databases created and see all the tables in them. If you have terminal access then follow the following steps :
1. Connect to MySQL

mysql [-u username] [-h hostname] database-name

2. List all the databases :
show databases

3. Choose your db:
use <database-name>

4. List all the tables
show tables

Q :  In dbms how to find how get tables i have created??

4 years ago

iamabhishek

iamabhishek

We are looking for some good suggestions from our users to help better the website.

Q :  Will Online Compilers(C, C++, Java) be a good addition to Studytonight?

4 years ago

iamabhishek

iamabhishek

Yes, we will have some interesting exercises written on top of the compiler.

Q :  Will Online Compilers(C, C++, Java) be a good addition to Studytonight?

4 years ago

iamabhishek

iamabhishek

First question is a little tricky-
A Java file represents a class. If you had a procedure outside the class, what would the scope be? Would it be global? Or would it belong to the class that Java file represents?
Java was designed to be simple and object oriented. Functions are meant to operate on the classes they are defined in. With that line of thinking, having functions or variables outside of a class doesnt make sense.

For the second one I would say, Java too has pointers. Pointer is nothing but address of some other variable, which in Java is references. But, arithmetic operations cannot be performed on references like they can be done on pointers.

Q :  Why all of defined inside class in java?

4 years ago

iamabhishek

iamabhishek

A loader is a program used by an operating system to load programs from a secondary to main memory so as to be executed. Usually large applications are written into small modules and are then compiled into object codes.
A linker is a program that combines these object modules to form an executable.
So a Linker is not same as a Loader. We can say, Linker is always used before programs are executed will be correct.

Q :  The linker ?

4 years ago

iamabhishek

iamabhishek

Left and Right shift operator, shifts the value on the left side of the operator as many times as the number on right.

In our case,

3 << 2


So 3 will be left shifted 2 times. During shifting left, left most digit is removed from the binary representation and instead a 0 is added on the right.

3 is 0011 in decimal binary form. Shifting it one time to the left will give us 0110 and once again, 1100, which is binary for 12.

Hence 3*4 = 3<<2

Q :  How (3*4) equalent to (3<<2)

4 years ago

iamabhishek

iamabhishek

Can you explain what do you require in Payroll program, like the use cases etc.

Q :  Payroll program

4 years ago

iamabhishek

iamabhishek

Web Service is a generic term given to any software or program available over web. As a standard, communication is carried out using XML messages. Web services are XML-based information exchange systems that use the Internet for direct application-to-application interaction.

Q :  What Is Webservice -explain which purpose use webservices

4 years ago

iamabhishek

iamabhishek

XML is a markup language just like HTML, can also be very well used to hold structured data.
CSV is a simple file format, where in the data is comma separated.
JSON stands for Javascript Object Notation. It is again a simple way to hold complex structured data.

JSON is very often used to transmit data between the client and server. XML can also be used for the same purpose, but JSON is simpler.

Q :  What is XML,CSV,JSON. Which purpose use in XML,JSON,CSV and where we use ?

4 years ago

iamabhishek

iamabhishek

Very interesting question. Try the below code, and it will work :

public class TestPac2 extends TestPac1 {
public static void main (String[] args)
{
TestPac1 tp = new TestPac1();
TestPac2 tp2 = new TestPac2();
System.out.println(tp.i);
System.out.println(tp.j);
System.out.println(tp2.k);
}
}


Now lets see why this works and your code doesnt work. In case of protected elements(functions or variables), to avoid ambiguity, Java prevents modification by the parent class inside the child class.
But Why so?
Because inside, class TestPac2 , k is its internal variable, and it can very well modify it safely. But reference of TestPac1 class can hold any of its child class object, what if it is not TestPac2, but TestPac3, which TestPac2 has no idea about. For TestPac2 to manipulate a protected variable of another subclass TestPac3 is very dangerous. Hence Java will never allow protected variables to be accessed via parent class reference.

But if tp is TestPac21 which is child of TestPac2, then TestPac21.k will work fine. Because in this case, TestPac2 has the right to modify the behaviour of any field that its child is inheriting from it and all the child classes have to follow it.

Q :  Could not be able to access protected field into sub class of different package. Please help!

4 years ago

iamabhishek

iamabhishek

If it is an ubuntu setup, check for error logs to find out the issue. You can find Apache server logs(if running apache) at /var/log/apache/error.log

Also try to restart Apache service or whatever Server you are running while monitoring the logs. For apache:

sudo service apache restart

Q :  What to do if linux server goes down?

4 years ago

iamabhishek

iamabhishek

Do share with us too, if you find some good book. The information will be useful for the users.

Q :  Can someone suggest a really good book for ethical hacking?

5 years ago

iamabhishek

iamabhishek

In Java, methods can always be defined inside a class, so you need to have a class. A method can either be directly called with class name if the method is STATIC(http://www.studytonight.com/java/modifier-in-java.php), otherwise we need Instance of class to call any method.

for example :

public class Car {
private void turnRight() {
System.out.println("Turn Right");
}
private void turnLeft() {
System.out.println("Turn Left");
}
public static void goStraight() {
System.out.println("Go Staright");
}
}

Now we can call the above defines methods like :
public class Test {
public static void main(String args[]) {
Car carObject = new Car();
carObject.turnRight();
carObject.turnLeft();
Car.goStraight(); // static method can be called using class
}

This is just a part of how methods can behave in Java, but there are many other concepts as well, check http://www.studytonight.com/java/method-and-overloaded-method.php

Q :  How to call a method

5 years ago

iamabhishek

iamabhishek

For creating a sidebar and Body part inside a webpage, you can follow the following steps :

<div>
<div style="width:80%;float:right">
<div>Body Content Div 1</div>
<div>Body Content Div 2</div>
</div>
<div style="float:left;width:20%"> This is Sidebar</div>
</div>

Like this you can create the structure, and inside the Sidebar also, you can have as many Divs as you want just like in Body Content.

Q :  How to use multiple div tags for body?

5 years ago

iamabhishek

iamabhishek

Please share the code, so that we can have a better idea. There are hundreds of situation where Eclipse shows compilation problem.

Q :  How to corrrect main method errors in java? eclipse is showing unresolved compilation problem to main method.

5 years ago

iamabhishek

iamabhishek

Hey Harsh,
Wasnt your last question about the same doubt. Please explain your doubt a little. What do you mean when you say -
"what will be display constructor of both class"?

Q :  If a constructor in super class & also sub class.we create object of sub class & reference variable of super class.In this situation, what will be display constructor of both class. Why & How?

5 years ago

iamabhishek

iamabhishek

Your code is :

class A { 
A () {
System.out.println("A");
}
}
class B extends A{
B() {
super(); //this call is by default added by Java
System.out.println("B");
}
}
public class C {
public static void main(String[] args) {
A d=new B();
}
}

By default Java adds call the super(); in all the child class constructor, to prepare the instances of the parent classe, so as to make the properties of the parent class available for use for the child class.
Therefore, you see the output to be first A and then B.

Q :  Class A { A () { System.out.println("A"); } } class B extends A{ B() { System.out.println("B"); } } public class C { public static void main(String[] args) { A d=new B(); } }

5 years ago

iamabhishek

iamabhishek

You can create a div or any other HTML block, by using echo inside the Php code, for example :

<?php
echo "<h1>This is a Heading</h1>";
echo "<div>This is a DIV block</div>";
echo "<p>This is a paragraph</p>";
?>


This is how you can do it. If you are facing some other issue, do share your code.

Q :  How to create a div in the embeded php script block of code?

5 years ago

iamabhishek

iamabhishek

Go to the Link : http://www.studytonight.com/tests/

You can easily find out whether there are tests for Windows Server or not :/

Q :  IS THERE TEST AVAILABLE FOR WINDOWS SERVER IN THIS?

5 years ago

iamabhishek

iamabhishek

You could have easily Googled it. Here, I did it for you :

In telecommunications and computer networking, a communication channel or channel, refers either to a physical transmission medium such as a wire, or to a logical connection over a multiplexed medium such as a radio channel.

Q :  What is meant by telecommunication channel

5 years ago

iamabhishek

iamabhishek

You have declared the class Circle as private. In Java, Top level class can never be private, inner classes can be.

Try this :

public class Circle {
private double radius;
}

Class CircleDemo {
public static main(String args[]) {
Circle cirObj = new Circle();
cirObj.radius = 10.03;
}
}

Q :  What is the error of this code pls mension any one....

5 years ago

iamabhishek

iamabhishek

Hey Richa,
There can be two things that you might be asking, which I can think of, so I will be explaining both.

If you want to resize textarea as the content is typed in, then do the following :

The JTextArea always has the correct size so all lines of text are visible. JTextArea sets its size dynamically, What you experience is probably that you wrapped the text area in a JScrollPane. Just omit the scroll pane and make the text area a direct child of the container. Also provide enough space in the container JPanel to allow growing of the JTextArea.

If you want to preset size of your textArea, then :

new JTextArea(5, 10);

Provide the number of columns and rows when you initialise it.

Q :  How can i resize textArea in java swing

5 years ago

iamabhishek

iamabhishek

Hey Tejas, Set is an Interface which doesnt provides any ordering on the elements, but LinkedHashSet is a class which implements Set Interface and does provides ordering on the elements.

Also there is a sub-interface of Set interface called SortedSet which does provides total ordering on the elements. This is the correct hierarchy. Hope this helps.

Q :  If Set is unordered then why LinkedHashSet is ordered

5 years ago

iamabhishek

iamabhishek

Having a Primary Key in your tables ensures row-level accessibility. Primary Key must always be unique for every row, there by allowing you to fetch any row, just on the basis of Primary Key.

I usually practice and keep the Primary Key AUTO_INCREMENT to avoid duplicate entries. But its upon you, how you wish to generate your Primary keys.

Q :  While creating tables in SQL, when it is essential to declare a primary key?

5 years ago

iamabhishek

iamabhishek

A metadata (also called the data dictionary) is the data about the data. When we create a Table or a schema, there is some information saved about it with the DBMS, Which it may or may not use, but it is there. Information like : Name, Type, Range of values, Source, Access authorization etc.

Just like when we click a picture in our camera, the camera saves a lot of extra information about the Picture, along with the picture like Date and time, then Camera Settings like Focal Length, Aperture, Exposure etc that is MetaData.

Hope it helps.

Q :  Describe about metadata in RDBMS

5 years ago

iamabhishek

iamabhishek

If you are using Servlet for the purpose, the following link will guide you stepwise :
http://www.studytonight.com/servlet/login-system-example-in-servlet.php

If you are doing something else, please share more info, so that I may help you better.

Q :  How to connect login page with database in java

5 years ago

iamabhishek

iamabhishek

For Android you must learn Java. You can start with C language, then moving on to C++ before Core Java, as you will understand Object Oriented programming better that way.

Q :  Application development

5 years ago

iamabhishek

iamabhishek

As you are asking about JSP and servlet, I assume you want to go for a Web project. MySql is a nice choice for database for any web based application.

And for Servlet and JSP part, here are some very cool small projects, which you can start implementing :

http://tuts.wtfdiary.com/2013/02/dynamic-file-upload-ajax-jsp.html

http://tuts.wtfdiary.com/2012/12/email-application-jsp-servlet.html

http://www.journaldev.com/4742/jquery-ajax-servlet-jsp-web-application-integration-example-tutorial

Q :  Hoe to do a small application project in java code?

5 years ago

iamabhishek

iamabhishek

Spooling is the process of putting something that needs to be done into memory until the program or computer is ready to execute those instructions.

Now, the question that will it be a standard feature in the future machines, is a little difficult to answer. Because if I think about, that spooling makes, machine function independent like in the most basic example of sending a file for printing, the printer saves the file(spooling), hence even if the file is deleted from the Parent machine, it will still get printed as it is being held in the local memory of the Printer.

That being said, as these days, data is being centralized, with all the devices connected to cloud, this can be skipped as all the data will be available all the time via cloud in near future.

Still Spooling will have its benefits of speed, local copy etc. But unnecessary and redundant space usage.

Hence I leave the discussion open.

Q :  What is spooling?

5 years ago

iamabhishek

iamabhishek

1. Kernel Mode
In Kernel mode, the executing code has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level, most trusted functions of the operating system. Crashes in kernel mode are catastrophic; they will halt the entire PC.

2.User Mode
In User mode, the executing code has no ability to directly access hardware or reference memory. Code running in user mode must delegate to system APIs to access hardware or memory. Due to the protection afforded by this sort of isolation, crashes in user mode are always recoverable. Most of the code running on your computer will execute in user mode.

LINK : http://blog.codinghorror.com/understanding-user-and-kernel-mode/

Q :  The difference between kernel mode and user mode

5 years ago

iamabhishek

iamabhishek

In computing, a system call is how a program requests service from a Operating System.

Q :  What is a system call in computer network

5 years ago

iamabhishek

iamabhishek

Blogging is not just about making money, its a way to share knowledge, or expressing your opinion by doing reviews etc or just personal heart-felt writeups.

Personalised write-ups, these days have moved to Twitter accounts, YouTube video accounts and Facebook Pages, and have moved away from core blogging.

Where as Tech, News, Food, Art blogs are still in fashion and are indeed great ways to put forward your knowledge or opinion about anything.

Yes, once, you start doing well, and a decent traffic starts running through you Blog channels you will earn money, but that is only after a while.

Being an Engineer the easiest is to start a technology blog, I myself had a blog named (http://wtfdiary.com) before starting Studytonight.

Its a dedicated task, you need to be patient, creative, and up-to-date. You can easily Google and find ways to quickly attract traffic, like writing guest blogs, posting comments on other blogs, regular articles, using Social Media, and other link sharing websites. The key is good and original content.

To start with, Blogger is a good platform, you can easily integrate a custom domain, available for as low as 200-300 INR these days.

Initially the earnings may look like negligible, but slowly over a period of 6 months you can very easily start earning 5000 INR (approx) if you write regularly.

Hope this helps. Do share your experience with us.

Q :  How to earn money only through blogging?

5 years ago

iamabhishek

iamabhishek

To build a successful career in the Database side, ofcourse you must have extensive knowledge about the same, which includes having knowledge about SQL and PLSQL.

Go through the DBMS course on Studytonight to start. http://www.studytonight.com/dbms/

Q :  What is important for career in database field sql , phsql or other subjects

5 years ago

iamabhishek

iamabhishek

Hey, We will soon have a course for Cloud Computing as well.

Q :  Is there any tutorial for cloud computing ?

5 years ago

iamabhishek

iamabhishek

Where do you think when you posted this Question using a Form, the question and its details were saved.

Yes, they were saved in a Database. And DBMS is nothing but Database Management System. We need different commands to insert data into database or read the data from it. Those are SQL Queries. Hope that is good for a quick introduction.

By the way, the answer that I am writing will also be saved into the database mapped to your Question :)

Q :  Why we need dbms?

5 years ago

iamabhishek

iamabhishek

A Gaming fan, but never been into development. But would love to have a healthy discussion over the same. I do have knowledge of a couple of platforms.

Q :  Any gaming fans,programmers,designers here?

5 years ago

iamabhishek

iamabhishek

Sorry for the late reply. I think you should try after adding a space between src="path" and alt="alternative text"

If it still doesnt work, please email us the code that you are trying to submit and the Lesson number and we will surely take a look :) Happy Diwali

Q :  Problem loading page

5 years ago

iamabhishek

iamabhishek

When you submit a link, please make sure you only add the URL into the Link field.

You must have copy pasted the Link from your blog, and it brought the Title of the Post and your Medium Account Username along with the URL, due to which you were not being redirected to the right URL. Fixed now.

And, welcome to Studytonight. Nice Links.

Q :  Why are links submitted to Study Tonight are not working ?

5 years ago

iamabhishek

iamabhishek

C language tutorials : http://studytonight.com/c

Q :  What is c

5 years ago

iamabhishek

iamabhishek

First though, it will be 300, but then you wouldn't have asked this question. I think 0 can be the answer. Am I right ?

Q :  What is the output of this statement:- (300*300)/300; and why?

6 years ago

iamabhishek

iamabhishek

Yes we can, here is a very simple example for you,


SELECT CustomerName
FROM Customers
WHERE State <> "MP"
GROUP BY State
HAVING Count(CustomerID) >10
ORDER BY Count(CustomerID) DESC

In this query, the where clause,
WHERE State <> "MP"

means, that where state is not MP.

Q :  Can we use all clauses like where,groupby,having & orderby in an single sql query?

6 years ago

iamabhishek

iamabhishek

Testing is used to test stuff. Would it be great if you try to access Studytonight and get errors. That is because we test it. So that is testing for, so that things work fine.

Q :  Why testing

6 years ago

iamabhishek

iamabhishek

Hi, thanks for being a vivid user of Studytonight. Being the Founder of Studytonight i would suggest you guys use this Forum actively. Help others and ask questions here.

Thank you!

Q :  Can we have whats up Group

6 years ago

iamabhishek

iamabhishek

If you want to create triangle using stars (*) then following is the program to do so, Enter the number of lines, to increase the size of the triangle.


#include<iostream.h>
void main()
{
int i, j, n;
cout<<"\Enter the number of lines to be printed: ";
cin>>n;
for(i = 0; i < n; i++)
{
for(j = n-i; j > 1; j--)
{
cout<<" ";
}
for(j = 0; j <= i; j++)
{
cout<<"*";
}
cout<<endl;
}
}


This will print pattern like below, for lines 4:
   *
* *
* * *
* * * *

Q :  How can i make star triangle by using for loops

6 years ago

iamabhishek

iamabhishek

Do you wan to make star shape or a triangle shape? Or, do you want to make triangle shape using star ( asterix * ) ?

Q :  How can i make star triangle by using for loops

6 years ago

iamabhishek

iamabhishek

Heap Sort Lesson on Studytonight http://www.studytonight.com/data-structures/heap-sort

Q :  Heap sort

6 years ago

iamabhishek

iamabhishek

Hello LeelaKrishna, very soon a new course will be introduced on Studytonight, which will empower School Students, College Students and even people with no coding background to create great apps using MIT's AppsInventor Tool. Search for the tools on Google, it makes developing great apps very easier.

Q :  Anyone please help me HOW TO DESIGN AN ANDROID APPLICATION

6 years ago

iamabhishek

iamabhishek

To give you an overview about the concept :

Private variables and member functions are not acessible to anyone, not even the child class.

Protected variables and member functions are available to the child class, and it can directly use them.

Where as the public ones are available to everyone.

Q :  What is diffrence between private & protector????

6 years ago

iamabhishek

iamabhishek

Implicit declaration is done by the compiler itself while explicit declaration is done by the user. For example the default constructor is defined by java, its defined and declared implicitly.

Q :  What is the difference between implicit parameters and explicit parameters in Java?

6 years ago

iamabhishek

iamabhishek

This will give you a good overview about arrays http://www.studytonight.com/c/arrays-in-c.php

Q :  What is the array? how can used array and where?

6 years ago

iamabhishek

iamabhishek

I would suggest you to go through this Flashcard set to know about all the important concepts of Java http://www.studytonight.com/flashcards/Java/

Q :  Important concept of java?

6 years ago

iamabhishek

iamabhishek

Here on this page you will find full description with examples http://www.studytonight.com/java/java-io-stream.php

Q :  File handling in java?

6 years ago

iamabhishek

iamabhishek

As explained by @ronak , Inheritance means getting properties from parent. Every class in C++ has variables and member functions declared inside it, which are either private, public or protected.

Private variables and member functions are not acessible to anyone, not even the child class.

Protected variables and member functions are available to the child class, and it can directly use them.

Where as the public ones are available to everyone.

Whenever a child class is creating inheriting a parent class, it will get whatever the parent class has (protected and public) variables and member functions, hence the child class can directly use them, without declaring and defining them again.

Q :  What is inheritance?

6 years ago

iamabhishek

iamabhishek

Go through the following tutorial, http://www.studytonight.com/cpp/access-control.php

And then you can ask in what you are facing the problem.

Q :  What is diffrence between private & protector????

6 years ago

iamabhishek

iamabhishek

Go through this Lesson http://www.studytonight.com/data-structures/merge-sort and if you still face problem. Then let me know, i will be happy to help.

Q :  Merge sort data sturcture

6 years ago

iamabhishek

iamabhishek

WebRoot SecureAnywhere antivirus, Bitdefender Antivirus Plus, McAfee Antivirus Plus, Norton etc are some of the good Antiviruses available.

Rest it depends on your budget too, because these are not available for free.

Q :  Which is the best antivirus?

6 years ago

iamabhishek

iamabhishek

Your question is not clear, can you please explain it. What exactly you mean by implementing hardwares?

Q :  What are the suggestions for implementing hardware in computer lab?

6 years ago

iamabhishek

iamabhishek

If you want to know about JIT in details, i suggest you read all the answers on these two webpages.

http://stackoverflow.com/questions/95635/what-does-a-just-in-time-jit-compiler-do

http://stackoverflow.com/questions/2903113/what-does-a-jit-compiler-do

Q :  What is JIT in java?

6 years ago

iamabhishek

iamabhishek

Please do not ask such questions, go and study C language. No one can make you understand C language by posting an answer here. The internet is full of C language tutorials. You can also find it on Studytonight.

Q :  What is c language

6 years ago

iamabhishek

iamabhishek

Implicit declaration is done by the compiler itself while explicit declaration is done by the user. For example the default constructor is defined by java, its defined and declared implicitly.

Q :  Difference between implicit and explicit declaration?

6 years ago

iamabhishek

iamabhishek

Android application can be developed only with Android SDK provided by google which is based on Java.

You can start learning from the following link http://developer.android.com/training/basics/firstapp/index.html.

Q :  Can we create Android application with Python language ?

6 years ago

iamabhishek

iamabhishek

These are storage classes in c language. Please follow this link, you will understand better http://www.studytonight.com/c/storage-classes-in-c.php

Q :  Use of auto ,static,register, extern with example

6 years ago

iamabhishek

iamabhishek

You will find good explanation and examples here... http://www.studytonight.com/c/switch-statement-in-c.php

Q :  What is switch?

6 years ago

iamabhishek

iamabhishek

You will have to look at the various header files. The more you learn the more you know. There is no defined way or rule of using header files. conio.h , math.h , stdio.h etc all these header files have pre-defined functions.

You will have to find the header files to use any pre-defined function.

Q :  How can i know that which header file is useful for a specific program?

6 years ago

iamabhishek

iamabhishek

If you have found the solution, please do share with us.

Q :  HOW TO SPLIT A 4 WAY B TREE

6 years ago

iamabhishek

iamabhishek

Whenever an exception is thrown by a program, or when there is a possibility of an exception occuring. Try-Catch block is used.

throw keyqord is used to throw specific exception.

For example :

try {
Your code, which may throw exception
}
catch(Exception e) { //do anything }


Here, the piece of code which might throw exception is kept within try block followed by a catch block which will catch the exception. You can then either print the exception inside catch, or do anything else.

Q :  What is keyword try,catch and throw???

6 years ago

iamabhishek

iamabhishek

A null pointer is a pointer that does not point to any object or function.

#include <stdio.h>
int main()
{
int *ptr = NULL;
printf("The value of ptr is %u",ptr);

return 0;
}

Q :  What is null pointer?

6 years ago

iamabhishek

iamabhishek

return statement is used to make the function give a result back. For example,

int sum(int x, inty) {
int z = x + y;
return z;
}


In this function, x and y are inputs and the sum of x and y is stored in z and it is returned. So when you call this function, it will return the sum of x and y.
int result = sum(5,5);


Now, result will have value 10. sum() function will return the value 10 here.

Q :  Why we use return type in function?

6 years ago

iamabhishek

iamabhishek

Hi, you search it on Google. Right now studytonight doesnt have any tutorial on UNIX. But soon it will be included.

Q :  Need unix tutorial video

6 years ago

iamabhishek

iamabhishek

You can easily find many example on Internet. Just Google it.

Q :  I Have many Example on array

6 years ago

iamabhishek

iamabhishek

iOS, is the mobile operating system developed by APPLE for its mobile devices. It is only available in Apple's devices. Like Android is a Mobile Operating System, so is iOS.

Q :  What is IOS???

6 years ago

iamabhishek

iamabhishek

Regular arrays have the same number of elements in every instance of a given dimension. In an array created by a[3,7], the upper bound will always be 7 for all three rows (a[0,7] , a[1,7] , a[2,7], a[3,7]). Regular arrays can be thought of as rectangular.

Irregular arrays don't need to have the same number of elements in every instance of a given dimension. For example, the upper bound column number of rows in irregular array could be b[0,3] , b[1,*] , b[2,5] , b[3,2] (where * means no elements are allocated in this subdimension). Therefore, irregular arrays cannot be thought of as rectangular, but can be thought of as ragged arrays.

It can be implemented in C++ in following way

// declare a two-dimensional array variable
// and allocate the desired number of rows
int ** irregularArray = new int* [numberOfRows];
// now allocate space for the elements in each row
for (int i for (int i = 0; i < numberOfRows; i++) 0; i < numberOfRows; i++)
irregularArray[i] = new int [length[i]];


And here is a complete program for the same.
#include < iostream > 

using namespace std;

int main()
{
int n, i, k;
int **x;
int *y;

cout << "Enter the number of rows: " << endl;
cin >> n;

x = new int * [n];

for (i = n, k = 0; i > 0; i--, k++)
{
y = new int [i];
x[k] = y;
}
return 0;
}


Sorry for replying late, hope this helps.

Q :  What is an irregular 2-d array?program in c++ that creates and uses an irregular 2-d array?

6 years ago

iamabhishek

iamabhishek

One more point to be made, Pure Physical Memory based system was very efficient in executing processes, but very poor for multitasking and CPU utilization.

Hence Virtual Memory was created :)

Q :  What is paging exactly?

6 years ago

iamabhishek

iamabhishek

Consider it this way, in early days when there was only physical memory in CPU, the process was transferred to the physical memory for execution.

To increase the efficiency and to increase multitasking the physical memory was supposed to be increased so that it could hold more processes at one single time.

The solution to this was, introducing a virtual Memory, where processes will be stored in form of logical address. Logical Address is nothing but detailed information of its program, how many pages are there, words in each page etc.

At compile time the logical address for program is generated and the CPU is free to choose Physical Memory address, large enough to hold the pages of the process and Maps the physical address with logical address.

After which its normal Demand Paging concept. When the process requires any page, CPU puts it into the main memory.

Check out lesson at Studytonight :
http://www.studytonight.com/operating-system/virtual-memory

Also, if you want to know the exact logic with numerical example. Like how actually mathematically CPU does this, based on the number of Pages, words/page, size of frames, no. of bits etc, then go for this tutorial http://garryowen.csisdmz.ul.ie/~cs4023/resources/sol11.pdf

And as any doubt, if any :)

Q :  What is paging exactly?

6 years ago

iamabhishek

iamabhishek

You can use std::freopen to redirect your standard output to a file. I found this code example online, hope it works for you

#include < stdio.h >

int main ()
{
freopen ("myfile.txt","w",stdout);
printf ("This sentence is redirected to a file.");
fclose (stdout);
return 0;
}

Q :  How can i use files in C++?

6 years ago

iamabhishek

iamabhishek

Follow this link : http://tutorials.jenkov.com/java-reflection/dynamic-proxies.html

Ask any doubts if you have any.

Q :  What is dynamic proxies?

6 years ago

iamabhishek

iamabhishek

Concurrency control is a technique to maintain data integrity by no allowing two DML queries to alter the data simultaneously. It can be done in various ways like -

- By acquiring LOCK on the table.

Locking is done in various ways, you can easily learn about that on Internet.

Q :  Explain the concurrency control techniques

6 years ago

iamabhishek

iamabhishek

Rails using Ajax is no different. It simply means using AJAX for dynamic data movement, in a Rails application.

Q :  What is Rails using ajax..Is rails another programming language???

6 years ago

iamabhishek

iamabhishek

http://www.studytonight.com/java/inheritance-in-java go through his, you will get a good information about inheritance.

Q :  What is ment by inheritance

6 years ago

iamabhishek

iamabhishek

You can use AVG() function for calculating the average. If you are using AVG() function already, it can be done using the following query.

Select AVG(<population_column>) FROM <table_of_countries> WHERE country_name in ('Poland','Germany','Denmark');

Q :  What is the syntax of querying the average of more than two attributes of a given column in sql

6 years ago

iamabhishek

iamabhishek

Visual Studio compiler addes 8 bytes more as compared to other compilers in variables, classes etc. This is by design. Check this article, you will understand it better http://lolengine.net/blog/2012/10/21/the-stolen-bytes

Q :  What is the Size of class here?

6 years ago

iamabhishek

iamabhishek

The main function is the function which is executed, so it will act as the index file.

Q :  How to create a index file in c language

6 years ago

iamabhishek

iamabhishek

check this out http://www.studytonight.com/cpp/virtual-destructors.php

If you face any problem in understanding then you can ask.

Q :  What is virtual destructor?

6 years ago

iamabhishek

iamabhishek

What do you mean by Data Type of Integer, Integer is a data type itself and so are all the other mentioned by you in the question.

Please explain your problem in detail.

Q :  Write down the data type of Integer, Long Integer,Fractional Number & A special character

6 years ago

iamabhishek

iamabhishek

Check out the DBMS lessons on Studytonight. And please do not post such questions here.

Q :  Basic concept of dbms

6 years ago

iamabhishek

iamabhishek

1) Interface Runnable have only 1 method which you mandatory to implement.
2) If you need other methods like suspend() resume() sleep() join() yield() and stop() then
go for extending class Thread
3) Extending the Thread class will make your class unable to extend other classes, because of the single inheritence feature in JAVA.
4) If you want to execute run() method for multiple no of times then its better to you Runnable.

Q :  Why do we have to create thread in two ways?

6 years ago

iamabhishek

iamabhishek

#include<stdio.h>
#include<process.h>

void main() {
FILE *fp1, *fp2;
char a;
clrscr();

fp1 = fopen("test.txt", "r");
if (fp1 == NULL) {
puts("cannot open this file");
exit(1);
}

fp2 = fopen("test1.txt", "w");
if (fp2 == NULL) {
puts("Not able to open this file");
fclose(fp1);
exit(1);
}

do {
a = fgetc(fp1);
fputc(a, fp2);
} while (a != EOF);

fcloseall();
getch();
}

Q :  How to copy one file in to the other

6 years ago

iamabhishek

iamabhishek

If you are looking for a nice overview of this topic check this out http://www.eng.auburn.edu/~sealscd/COMP6620/project/SoftwareDevelopmentProcess/JAD.pdf

otherwise for detailed introduction read this http://www.umsl.edu/~sauterv/analysis/488_f01_papers/rottman.htm

Q :  Joint application development

6 years ago

iamabhishek

iamabhishek

naren is absolutely correct. Inheritance in programming language is same as in us humans. Like a child inherits characteristics from its parent, similarly when a class extends another class, it will inherit the properties and methods defined in that class.

Q :  What is inheritance

6 years ago

iamabhishek

iamabhishek

You can Google it, you will surely find them.

Q :  I want to know if i can get notes on system analysis and design

6 years ago

iamabhishek

iamabhishek

An object-oriented database management system (OODBMS) is a database management system that supports the creation and modeling of data as objects. OODBMS also includes support for classes of objects and the inheritance of class properties, and incorporates methods, subclasses and their objects.

Q :  What is oodbms

6 years ago

iamabhishek

iamabhishek

Yes, there should not be any = sign with LIKE cluase

Q :  Is this Like clause correct? SELECT * from Student Where s_name Like= '_d%'; ?

6 years ago

iamabhishek

iamabhishek

detailed discussion here http://stackoverflow.com/questions/3162665/immutable-class

If you dont understand anything, then ask.

Q :  What are immutable classes

6 years ago

iamabhishek

iamabhishek

CSS file is used to style HTML output, which is executed on the browser, which is the client side. And although we can use dynamic generated CSS, there isn't much use of it.

I found a good discussion here, check this out http://programmers.stackexchange.com/questions/118052/why-dont-we-use-dynamic-server-side-generated-css

Q :  How to use css in server side

6 years ago

iamabhishek

iamabhishek

\t is for tab space while printing anything using printf in c language

Q :  What is the use of \t in c language.

6 years ago

iamabhishek

iamabhishek

Black Book is a good book to start with. You can also find plenty of resources online for SQL and PL/SQL. For SQL, i would suggest you to go through Studytonight lessons.

Q :  I want know about a good book which clear my sql and pl/sql basic things with example

6 years ago

iamabhishek

iamabhishek

Mobile Computing is "taking a computer and all necessary files and software out into the field". Mobile computing is any type of computing which use Internet or intranet and respective communications links, as WAN, LAN, WLAN etc.

Q :  Define mobile computing

6 years ago

iamabhishek

iamabhishek

In Javascript we can use regular expressions to do so. You can easily find regular expressions to validate email address, passwords, usernames etc.

For example you can validate a field to have only Alphabets by using following regular expression

var nameRegex = /^[a-zA-Z\-]+$/;

You can also follow this link to study regular expression usage in details.
http://www.regular-expressions.info/

Q :  I wanted to know about form validation in javascript

6 years ago

iamabhishek

iamabhishek

Yes, we can overload a method more than three times, infact as many times as you want you can overload a method. Just keep changing the argument for every new overloaded method and you will get as many overloaded methods as you wish

Q :  In method overloading , can't we overload more than three methods?

6 years ago

iamabhishek

iamabhishek

I cannot understand your problem. Can you please explain it.

Q :  How to show a message like ms word notepad when type character in find line box

6 years ago

iamabhishek

iamabhishek

For web development, you must start with HTML, CSS, then go for a server side scripting language, i suggest PHP, you can research about server side scripting languages. Then slowly start using javascript and jquery.

In the same way, first begin with C++, you will cover C basics in C++ and then go for Java

Q :  Learning language sequence.

6 years ago

iamabhishek

iamabhishek

Java is completely Object Oriented Language, so just the basic C language knowledge is not sufficient to smoothly go through and understand Java. Studytonight will provide you with good explanation, but you will have to work hard.
I suggest you must join a good institute, while for self study you can use studytonight.com, that will be good approach.

Q :  If somebody don't know much about C,C++ but knoww basics of C then can he learn core java ?

6 years ago

iamabhishek

iamabhishek

You can easily find it on Google. In C++ we use new() to dynamically allocate memory. For C language we use malloc etc. This link will help you http://www.studytonight.com/c/dynamic-memory-allocation-in-c.php

Q :  Explain in detail about dynamic memory allocation?

6 years ago

iamabhishek

iamabhishek

Explaining the complete real time problem here will be very difficult. I suggest you go through this link, and then we can discuss your problem, if any. http://research.microsoft.com/en-us/people/philbe/ccontrol.aspx

Q :  What is concurrency control

6 years ago

iamabhishek

iamabhishek

Please do not post such questions here.

Q :  Want material for data structures

6 years ago

iamabhishek

iamabhishek

You can use std::sort() function for this. It can be used in two ways,

1. std::sort(myvector.begin(), myvector.end())

2. std::sort(myvector.begin(), myvector.end(), myCompFunction)


To sort an array of numbers, following is the code,

#include &lt;iostream&gt;
#include &lt;algorithm&gt;
using namespace std;
const int SIZE = 7;
int main()
{
int intArray[SIZE] = {5, 3, 32, -1, 1, 104, 53};
//Now we call the sort function
sort(intArray, intArray + SIZE);
cout << "Sorted Array looks like this." << endl;
for (size_t i = 0; i != SIZE; ++i)
cout << intArray[i] << " ";
return 0;
}

Q :  Sort numbers using stl in c++

6 years ago

iamabhishek

iamabhishek

Hello saba, can you please explain your problem. What do you mean by containership here. You can study Inheritance in C++ from Studytonight also.

Q :  I study in c++.

6 years ago

iamabhishek

iamabhishek

You can easily find the Time Complexity Topic and various sorting algorithms with their time and space complexity in lessons on STudytonight.

Q :  What are the best and worst cases of each and every sort?

6 years ago

iamabhishek

iamabhishek

Please provide code, for questions related to source code.

Q :  Why we doesnt write & in case of array in scanf function?

6 years ago

iamabhishek

iamabhishek

i mean..can you please explain your question in detail.

Q :  Define Path in C++

6 years ago

iamabhishek

iamabhishek

can you please explain your answer

Q :  Define Path in C++

6 years ago

iamabhishek

iamabhishek

i dont think its possible. If you do find an answer please do share with us...

Q :  How to print values without using format specifier

6 years ago

iamabhishek

iamabhishek

there are two file pointers in C++
one to read (get pointer) and other to write (put pointer)

tellp() - tells the position of the put pointer
tellg()- tells the position of the get pointer
both returns long int. The position of the pointer from the start of the file...
eg. content of the file hello world. consider.. it returns 3 , if the get pointer is at l

seekp() and seekg() are to position the put and get pointers in some random position.
consider.. u want to read only from world. then u can move using seekg() to the start of w.

refer ftell() and fseek() of stdio.h ( C language)

Q :  Difference between seekg() and seekp()

6 years ago

iamabhishek

iamabhishek

It will be undefined, and if you print it, as you are doing, it will give a random result.

Q :  What is the default value of character in c

6 years ago

iamabhishek

iamabhishek

You can get a detailed and very simple explanation here http://www.studytonight.com/cpp/inline-functions.php

Q :  What is inline function in cpp

6 years ago

iamabhishek

iamabhishek

To store questions or Text in Database you can use Insert queries. And then to generate it randomly, use SELECT query and RAND attribute in it.

Example : To insert question in tbl_que table
INSERT into tbl_que(question) value('$question');
where $question is the php variable carrying value for question. This will insert the data.

Now use, SELECT question from tbl_que ORDER BY RAND();

This will return the questions in random order.

Q :  How to store questions or text in database and generate it randomly with php code??

7 years ago

iamabhishek

iamabhishek

Cloud is a very vast area to discuss. I will give you a very basic example. We all have MS Word in our Computers. We all individually buy its licence and then use it. Not with Microsoft Azure service, MS Word services are provided on cloud. One MS Word software is placed on Cloud, from where every one can access it using Internet. And can pay for the time they use it. This is the gist of Cloud Computing

Q :  What is cloud computing

7 years ago

iamabhishek

iamabhishek

Rosette in particular has many different meanings, as far as Networking is concerned, Rosette Box is a plastic enclosing the wire circuit with an opening to fit in incoming LAN or other cable. Here i found a picture of it, this will help you http://www.slt.lk/sites/default/files/product_images/DSC_5745.png

Q :  What is rosette box?

7 years ago

iamabhishek

iamabhishek

Super key stands for superset of a key. A Super Key is a set of one or more attributes that are taken collectively and can identify all other attributes uniquely.

A Candidate Key is minimal Super key. That means, it cannot be broken further into Super key.

Q :  What is difference between Candidate key and Super Key?

7 years ago

iamabhishek

iamabhishek

you can refer to the question asked before your question. People have advised some books in that.

Q :  Which Book of DBMS I use for the preparation of technical interviews?

7 years ago

iamabhishek

iamabhishek

We use for loop, to traverse an array. As array has a collection of data, we need a loop to execute the same command on all the data in the array. To print, to insert or to do anything on the complete array we need to use a loop. We can use a WHILE LOOP or FOR LOOP.

You can find how to use loops in C language lessons on Studytonight.

Q :  Why we use for lop in array ?

7 years ago

iamabhishek

iamabhishek

I think tutorialpoint.com has some decent lessons for .net

Q :  Which site is best for learning dot net???

7 years ago

iamabhishek

iamabhishek

We do not have expertise in that, if you can help us with that we can surely think of adding those subjects. If you know some one who has good knowledge of these subjects, let us know :)

Q :  Please add other subjects regarding to mechanical

7 years ago

iamabhishek

iamabhishek

Following are the components of dbms -
1. Software - DBMS software, Operating System everything comes under this.
2. Hardware - COmputer, Storage devices, I/O devices etc
3. Data
4. Procedures - Procedures refer to the instructions and rules that help to design the database and to use the DBMS
5. Database Access Language - The database access language is used to access the data to and from the database. eg: SQL etc

Q :  Can i have the brief explanation of components of dbms

7 years ago

iamabhishek

iamabhishek

You can easily Google this. There are abundant books. Or you can give some options to choose from if you are confused

Q :  Which book is use in dbms for full concepts?

7 years ago

iamabhishek

iamabhishek

Nested structures are used in the case when you have a case where you need to have a property in a structure which must have properties of its own. For example : If we have records of an Employee, with his Name, Position and Date of Joining. And you wish to have Date of Joining to have day, month and year mentioned.

Then you can simply create a separate structure for Date and can use it in the Employee structure.
<code>struct Employee
{
char ename[20];
int ssn;
float salary;
struct date
{
int date;
int month;
int year;
}doj;
}emp1;</code>
or, you can declare them separately too...
<code>struct date
{
int date;
int month;
int year;
};
struct Employee
{
char ename[20];
int ssn;
float salary;
struct date doj;
}emp1;</code>

accessing the nested structure is very easy, you can do it by using '.' operator.

emp1.doj.month will return the month.

Q :  What is the use of nested structure?

7 years ago

iamabhishek

iamabhishek

You can easily study about mapping cardinalities in details at http://www.felixgers.de/teaching/sql/db_mappings.html

Q :  Tell me the mapping cardinalities??

7 years ago

iamabhishek

iamabhishek

You can find detailed sorting lessons on Studytonight. Go to the Data Structures tutorials.

Q :  What is sorting?

7 years ago

iamabhishek

iamabhishek

In a Linked List the Last node is not pointing to any node, as it is the last node hence, it must not hold address of any further node, but if it does, that means there is a loop, and you can also get to know to which node the last node is pointing.

So its very simple to find out, even if it is not circular at initial and final but in middle position.

Q :  How to say a linked list is circular linked list

7 years ago

iamabhishek

iamabhishek

I guess yes. On Internet you will find everything, you wish to study. For C Language you can depend on lessons here on Studytonight. Rest is all practicing.

Q :  Is the test book or online courses are enough to learn c perfectly

7 years ago

iamabhishek

iamabhishek

Designing the Home page can be very easier if you use any framework, like Twitter Bootstrap or may Flat UI. You can easily find readymade home page templates which you can use.

Even Studytonight is made on Twitter Bootstrap.

Q :  How i design my project home page?

7 years ago

iamabhishek

iamabhishek

In procedural programing our code is organised into small "procedures" that use and change our data. And In object oriented programming, the data and related functions are bundled together into an "object". This means that your data is locked away inside your objects and your functions provide the only means of doing something with that data.

Rest you can very easily google this, if you face any specific problem then ask here.

Q :  What is object oriented and procedure oriented programming paradigm

7 years ago

iamabhishek

iamabhishek

You can check out Studytonight's Library, take a look at the Topical Tests, go for Online Video Courses, its all out there, you don't have to ask anyone about this.

Q :  What are the courses obtained?

7 years ago

iamabhishek

iamabhishek

yes, this website is absolutely free. Go ahead and join and also invite your friends.

Q :  Is this site is free to us to learn?

7 years ago

iamabhishek

iamabhishek

Its a class for which only a single object can be instantiated at a time.

Q :  What is singleton class?

7 years ago

iamabhishek

iamabhishek

If you want a detailed answer you must explain your problem in detail.

Q :  How to create a project proposal or requirement documentation for tailoring software(tailor)?????

7 years ago

iamabhishek

iamabhishek

They are all over the Web. You can easily learn HTML, CSS and XML from various websites. W3Schools being one.

Q :  Internet technology and web designing

7 years ago

iamabhishek

iamabhishek

Right now, i dont think so that we can help you with this.

Q :  Will you help me to Provide a material for the stydy of visual basic 6.0

7 years ago

iamabhishek

iamabhishek

By next week, we will publish the Operating Systems Lessons. We are working on it. Wait for some time.

Q :  Can you please start new section over operating system?

7 years ago

iamabhishek

iamabhishek

i dont think there is any way to recover any table, unless you created a backup file for you database schema...

Q :  About mysql

7 years ago

iamabhishek

iamabhishek

System.in.read() reads the input entered by a user, hence the code snippet here, while keep appending whatever is entered by the user, until a new line ( \n ) character. after which it will not append.

Q :  While((c =(char)System.in.read())!='\n'){ string.append(c); }

7 years ago

iamabhishek

iamabhishek

A transaction is two-phase locked if :

- before reading x, it sets a read lock on x
- before writing x, it sets a write lock on x
- it holds each lock until after it executes the corresponding operation
- after its first unlock operation, it requests no new locks

Q :  2 phase locking protocol

7 years ago

iamabhishek

iamabhishek

can you please share more details about the error, if you have not already solved it.

Q :  Failed to generate a user instance of SQL Server due to a failure in starting the process for the us

7 years ago

iamabhishek

iamabhishek

Thanks Piyush, for writing such a great answer and helping other users here.

Q :  What is the function of import in java?

7 years ago

iamabhishek

iamabhishek

You can find detailed description about Java Collection in Studytonight's Lessons. Please study from there, and then ask any specific doubt, in case you have any.

Q :  Describe in detail, about Java's Collection Classes.

7 years ago

iamabhishek

iamabhishek

The SQL concepts will be same. But some syntax may differ. Like some Queries might be different in Microsoft SQL server.

Q :  The Database lesson available here is it usable with Microsoft SQL Server?

7 years ago

iamabhishek

iamabhishek

Tables are made Indexes just to access data from them faster. When you make any Table as Index, the Select query on that table will become faster, while the Insert queries will become a bit slower.

When we Index any Table, an Index for that table is created, it is basically a data structures like technique, to access data faster.

CREATE INDEX index_name ON table_name (column_name) ;

Above mentioned is the query to create an Index for a Table.

Q :  What is meant by index? how to create index for tables?

7 years ago

iamabhishek

iamabhishek

Java caches the integer objects in the range -128 to 127. So, when you try to assign a value in this range to a wrapper object, the boxing operation will invoke Integer.valueOf method and in turn it will assign a reference to the object already in the pool.

On the other hand, if you assign a value outside this range to a wrapper reference type, Integer.valueOf will create a new Integer object for that value. And hence, comparing the reference for Integer objects having value outside this range will give you false.

From source code of valueOf method, we can see the given

public static Integer valueOf( int i ) {
if(i >= -128 && i <= IntegerCache.high)
return IntegerCache.cache[i + 128];
else
return new Integer(i);
}


So if value is between -128 to 127, first the Cache is checked and if not found, then a new Integer object is initialized.

Q :  What is interger constant pool? how its differ from string constant pool?

7 years ago

iamabhishek

iamabhishek

You can easily download Oracle from Oracle's website. From here you can download Oracle 10G, click on accept agreement at the Top and then Download the software for your OS.

http://www.oracle.com/technetwork/middleware/ias/downloads/101310-085449.html

Q :  I need to download ORACLE or SQL...pls suggest a GUD website

7 years ago

iamabhishek

iamabhishek

What is the issue, can you please tell us, what error message you are getting. If you are getting TNS Listener issue, you need to go to services and start the TNS Listener service

Q :  Setup Oracle SQL developer

7 years ago

iamabhishek

iamabhishek

You will not find any Projects here. There are no projects on Studytonight.

Q :  Can i download projects in java from this site

7 years ago

iamabhishek

iamabhishek

WHERE clause is used to include any condition into the SELECT sql query, where as HAVING is used when we use GROUP BY in the SELECT query. You can study more about it by visiting following links.

HAVING Clause : http://www.studytonight.com/dbms/having-clause

WHERE clause : http://www.studytonight.com/dbms/where-clause

Q :  What is the Different B/W Where and Having Clause? explain with example.

7 years ago

iamabhishek

iamabhishek

I am also an Engineer, working in the Core Java Domain.

Q :  Which is the best site to learn Android fully ?

7 years ago

iamabhishek

iamabhishek

This is a very good question, i searched over the internet, but couldn't find any strong reason, preprocessor is one of the reason, but still no strong reason as such.

I want people here to look for an answer and share with us...

Q :  Why is hash(#) used?

7 years ago

iamabhishek

iamabhishek

There are plenty of websites for basic tutorials, you can pick any one and go through the tutorial, once you become good with the basics, start developing small applications, and eventually you will learn things. For some great tutorials about Android implementation, this is the best Blog on internet ( http://www.androidhive.info/ )

Go through this blog, from start, you will find simple and easy tutorials.

Q :  Which is the best site to learn Android fully ?

7 years ago

iamabhishek

iamabhishek

You will get absolutely everything related to your question on Studytonight. Refer this link, http://www.studytonight.com/java/package-in-java.php You will find good examples and the answer to your question

Hope it helps :)

Q :  Should we import a predefined package in user defined package

7 years ago

iamabhishek

iamabhishek

Iterative Statements execute any piece of code repeatedly in a loop. "for" Loop, "while" loop, "do while" loop can do so.

Q :  Please explain Iterative Statements......

7 years ago

iamabhishek

iamabhishek

@dipesh1406 I searched through a lot of tutorials on the Internet, but was unable to find any tutorial to do this using CSS only.

I think jQuery will make this task simple. Why you don't want to use JQUERY for this ?

Q :  How to create menubar in CSS & JQuery

7 years ago

iamabhishek

iamabhishek

.NET is a good language to learn, but as per my experience i think JAVA stands out in the crowd, if you want to get into a good programming job.

Q :  What topics goes in .net ? please any one can evaluate

7 years ago

iamabhishek

iamabhishek

Here we have a very detailed explanation. Go through it, if you face any problem then reply back. We will discuss your problem.

Q :  What is collection in java

7 years ago

iamabhishek

iamabhishek

Constructor is used to initialize a class instance. You can give default values to the class properties in the constructor.

For Example.
Class B
{
String x;
int y;

public B()
{
x = "Hello";
y = 10;
}
}

In this class B, B() is the class constructor, now whenever you will do new B(); Constructor of this class will be called, and x will be initialized to "Hello" and y will get 10 as value.

You can find a lot of Lessons about Constructors, in C++ and JAVA tutorials on Studytonight. Go to Library and find it.

Q :  What is the use of constructor and why it is used??

7 years ago

iamabhishek

iamabhishek

If you are using it on Windows, i am afraid but there is no command to do that. I was also looking for it, but couldn't find anything on the Internet.

Q :  What is the command of clear screen on mysql commnd prompt

7 years ago

iamabhishek

iamabhishek

Here is a code snippet, for doing what you want to do. Simple CSS and JQuery used. You can also use Bootstrap for this, that will make your task even easier. But using Bootstrap just to add a single element into your website is very difficult task.

So go for this solution http://www.bootply.com/69848

Q :  How to create menubar in CSS & JQuery

7 years ago

iamabhishek

iamabhishek

abstract class are classes with atleast one abstract method. Abstract method is a method which is just declared inside the class and no definition is there.

Interface has all the methods undefined. Implementing class has to implement all the methods of the Interface.

Also this discussion will help you http://www.studytonight.com/studyroom/question.php?que_id=201

Q :  Difference between abstract ans interface

7 years ago

iamabhishek

iamabhishek

Creating a servlet application is very easy, you can find the Login System example in Studytonight's Servlet lessons also.

While for complete help, i suggest you go through this blog, it has some great tutorials to develop web applications using JSP and servlet http://www.programdiary.in/

Q :  Create a servlet application

7 years ago

iamabhishek

iamabhishek

Core Java is the best and most widely used programming language, while networking is also important as it is a part of the basic concepts of computer science.

So if you wish to dive into programming world, start with Core java, and if you want to have a tight hold over the basic concepts of computer science, then start with Networking and Operating Systems.

Q :  Java or networking

7 years ago

iamabhishek

iamabhishek

Multi tasking is just performing Multiple tasks at the same time. As we all know that in Programming world we achieve this by multi threading.

Here is an article to explain it with C++ http://www.codeproject.com/Articles/540912/Cplusplus-Threads-Make-your-multitasking-life-e

Q :  What is multi-tasking and all the operations related to it??????????

7 years ago

iamabhishek

iamabhishek

If R is a relation between X and Y, we show it as X->Y, here Y is functionally dependent on X. Now what does this actually means, this means that Y individually doesn't have any unique identity and for a unique identity it is dependent on X.

For example : A PAN(Permanent Account Number) identifies the employee specifically, but an employee name cannot distinguish the PAN because more than one employee could have the same name.

Also A functional dependency is trivial if Y is a subset of X, because then Y will always be dependent on X, being a subset of it.

We can discuss it further to make you understand it better.

Q :  What is functional dependency in dbms explain in brief with suitable example

7 years ago

iamabhishek

iamabhishek

Reports in SQL are visual(graphs and charts)information or data information generated based on data in any Table or Database. There are many tools and framework present to generate reports in MS-SQL Server.

Q :  What is reports in sql

7 years ago

iamabhishek

iamabhishek

As we know that an Interface never implements another Interface, hence Interface A will never implement Interface B. If Interface A has some method left() and Interface B has a method right() , if any class implements both A and B, it will define both the methods left() and right() and there will be no anomaly.

But in case of abstract class, if we have a class A, with method left() and class B with method right(). (Now things will get a bit tricky, so pay attention) We know an Interface never implements another function, but here in this case of abstract class, class B might extend class A, hence it can override method left() of class A, or vice versa. And then in multiple inheritance, if any class C tries to extend class A and class B, it will have one definition of right() coming from class B, while two definitions of left() from class A and class B. Which will generate an anomaly, and this anomaly is also called deadly diamond of death problem.

Hope this clears your doubt.

Q :  Can anyone tell me why multiple inheritance is allowed in interface and not in abstract class?

7 years ago

iamabhishek

iamabhishek

You can study normalization from here, simple and easy with example http://www.studytonight.com/dbms/database-normalization.php

Q :  Dbms normalforms explain?

7 years ago

iamabhishek

iamabhishek

View is like presenting data from a table in a custom manner, or may be data from more than one table. View can be called as a virtual table, which will contain columns (along with data) specified by you, from more than one table.

http://www.studytonight.com/dbms/sql-views.php (to study in detail)

Q :  Explain detailed in views?

7 years ago

iamabhishek

iamabhishek

You can find explanation of Normalization in DBMS lessons of Studytonight.
Go to : http://www.studytonight.com/dbms/database-normalization.php

Still if you face any problem or have any doubts then you can ask here.

Q :  Please explain Normlization and its types with good example.....

7 years ago

iamabhishek

iamabhishek

As explained by @narenselva , DROP command is used to drop (delete) a table from DB schema. Once you drop any table, it is permanently deleted.

While TRUNCATE command, re-initializes a table by deleting all its content and also initializes its primary key. TRUNCATE will make a table like its a newly created table.

Q :  What is difference between drop and truncate command

7 years ago

iamabhishek

iamabhishek

"throw" is used to throw any exception which you wish to catch, like in any method on occurrence of any error you can explicitly use "throw" to throw a certain exception, and write the catch() block to catch that particular exception, so that your code ends in a nice manner.

While "throws" is used to set a characteristic for any method, that this particular method throws this particular exception.

public void testThrows() throws NullPointerException { }

So in this case, we are specifying that this method can throw NullPointerException, so any one using this will take care of that.

I hope this will clear your doubt.

Q :  Difference between throw and throws in java exception handling.

7 years ago

iamabhishek

iamabhishek

No it is not useless, the reason behind the search result can be that, the customername in your table doesn't affect the sorting, and the sorting based on country and customername is same.

This query should order the result based on both the columns.

Q :  Result of below mentioned SQL is sorted by country only but is it useless we mention customername

7 years ago

iamabhishek

iamabhishek

Here in the below program we have used standard string objects which can be used using "std::string" and we can use many pre defined functions with this.

#include < iostream >
#include < string >
int main ()
{
std::string S1 = "Studytonight is the best website to learn programming";
std::string S2 = "best";
int pos = S1.find(S2); // position of "best" in S1
std::cout << pos ; // printing the position
return 0;
}


In this program if you remover "best" from S1, -1 will be printed, if you add one more best, the first occurrence of best will be printed.

Q :  Program that takes two input strings S1 and S2 and finds if S2 is a substring of S1 or not. If S2 is

7 years ago

iamabhishek

iamabhishek

Lock in DBMS is when a resource is being used by one executing query. In that case, the other query will wait or will fail.

Now if one query needs to delete some row, and another query is using that row for update or select, then it will set a Lock.

There are many ways to prevent dead locks in database, the best one is by executing queries in a transaction.

Q :  Prevensions for deadlock?

7 years ago

iamabhishek

iamabhishek

I think ".*s" is not a correct identifier, is it?

Q :  String format specifiers

7 years ago

iamabhishek

iamabhishek

Best and most widely used PHP framework these days are :
1. Laravel
2. Phalcon
3. Symfony2

other nice frameworks are : Yii and CodeIgniter. You can find very detailed and nice tutorials for almost all of these frameworks.

Q :  Which php framework is gud and the most useful??

7 years ago

iamabhishek

iamabhishek

Hey vishag007, right now, studytonight takes support from http://gravatar.com for profile picture. So what you should do is, go to http://gravatar.com, Login using your email address with which you registered for Studytonight. and then upload your picture there.

It will automatically come to your profile on Studytonight. It's very simple.

And to edit your Profile, you can hover mouse over the down arrow, besides facebook and twitter icon on your profile, and you can update your profile form there.

Q :  How i can set pro pic ?

7 years ago

iamabhishek

iamabhishek

The public keyword is an access specifier, which allows the programmer to control the visibility of class members. When a class member is preceded by public, then that member can be accessed by code outside the class in which it is declared.

In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started.

The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made.

The keyword void simply tells the compiler that main( ) does not return a value. As you will see, methods may also return values.

As stated, main( ) is the method called when a Java application begins. Keep in mind that Java is case-sensitive. Thus, Main is different from main. It is important to understand that the Java compiler will compile classes that do not contain a main( ) method. But the Java interpreter has no way to run these classes. So, if you had typed Main instead of main, the compiler would still compile your program. However, the Java interpreter would report an error because it would be unable to find the main( ) method.

Hope this answer helps you understand it.

Q :  Why public static void main?

7 years ago

iamabhishek

iamabhishek

Please explain your problem so that we can understand it and then answer it.

Q :  How rdbms store use ?

7 years ago

iamabhishek

iamabhishek

Yes thats right, please do not ask questions which can easily be googled.

Q :  Serialization

7 years ago

iamabhishek

iamabhishek

Static blocks are the block which are implicitly called when the class is instantiated that means when the instance of class is made.

Static statements are nothing, i do not understand what do you mean by static statement.

Static variables are the special type of variable which are created during the load time of class, or we can say when the class is instantiated.

and also there are Static methods. If you are still confused, please give an example of static statement, so that we can help you.

Q :  What is the difference between static block and static statement?

7 years ago

iamabhishek

iamabhishek

Nice explanation given, thanks @v123

Q :  Why we use group by clause in DBMS?

7 years ago

iamabhishek

iamabhishek

This is a very nice question, i liked solving it. First of all, the above code will give compilation error, because a variable argument always must be the last argument. But in go() function it is the first argument hence this will not compile.

This should be :

public class Barn {
public static void main(String[] args)
{
new Barn().go(1,"hi");
new Barn().go(2,"hi", "world");
}
public void go(int x,String... y)
{
System.out.print(y[y.length - 1] + " ");
}
}

Now it will work and output will be : hi world

Q :  These program which is having error

7 years ago

iamabhishek

iamabhishek

If there is no common attribute it won't be Natural Join.

Q :  If there are two tables and they no common attribute then what will be the natural join?

7 years ago

iamabhishek

iamabhishek

Your code is incomplete. Please make sure you post complete question.

Q :  I have to got errorr in to connect vb.net to ms access please give answer

7 years ago

iamabhishek

iamabhishek

java.lang.NoClassDefFoundError: hello (wrong name: Hello)

this is the issue, jonsen is right, you have named your class wrong, rename it to Hello.java and your class will compile.

Q :  I am new to java..just a beginner.i get error wen i compile hello prog

7 years ago

iamabhishek

iamabhishek

This is a very nice section, please if you find the solution to your problem, do share with us. We all want to know, how to use USB port in C or C++.

I personally think there should be some system calls, to interact with the hardware, some way to get the socket ports. I will look for the solution.

Q :  Any one know how to create port programing in c, i want to use usb port in c language.

7 years ago

iamabhishek

iamabhishek

There is no download link.

Q :  How to download meterial

7 years ago

iamabhishek

iamabhishek

The functions which are a part of standard C library are known as Library functions. For example the standard string manipulation functions like strcmp(), strlen() etc are all library functions.

The functions which change the execution mode of the program from user mode to kernel mode are known as system calls. These calls are required in case some services are required by the program from kernel. For example, if we want to change the date and time of the system or if we want to create a network socket then these services can only be provided by kernel and hence these cases require system calls. For example, socket() is a system call.

for detail refer : http://www.thegeekstuff.com/2012/07/system-calls-library-functions/

Q :  What is difference between system calls and library function in linux operating system ???

7 years ago

iamabhishek

iamabhishek

You will find complete explanation, along with examples to open, close, read and write in file here, http://www.studytonight.com/c/file-input-output.php

If you face any problem you can ask then.

Q :  What is file handling ????

7 years ago

iamabhishek

iamabhishek

http://www.studytonight.com/servlet/registration-form-example-in-servlet.php There is a nice example here, and in this example of creating a registration form, in class Register.java , there is code to connect to MySql database.

Reading an example will help you more.

Q :  How to connect a mysql database using servlets in eclipse kepler

7 years ago

iamabhishek

iamabhishek

i couldn't understand your question exactly, so i found you a couple of examples for your reference.

If you wish to include graphics into Java Applet,
http://www.wikihow.com/Use-Graphics-in-a-Java-Applet

If you wish to create Graphic instances in java Applet, then study below links,
http://stackoverflow.com/questions/15192670/how-to-create-graphic-instances-in-a-java-applet

Q :  How to create a graphics using java applet controls

7 years ago

iamabhishek

iamabhishek

You can create a custom comparator to sort through any arraylist. You can find those examples in Studytonight lessons also. Here is one more example:

If you have a class Empl, with employee data, name and salary and you create an array list for Empl objects,

List<Empl> list = new ArrayList<Empl>();

Now you can create a comparator for this,

class MySalaryComp implements Comparator<Empl>{
@Override
public int compare(Empl e1, Empl e2) {
if(e1.getSalary() < e2.getSalary()){
return 1;
} else {
return -1;
}
}
}

Q :  Comparator with arraylist collection?

7 years ago

iamabhishek

iamabhishek

You are absolutely right that we can write code withour using Pointers. But pointers were considered to simplify things, thats why they were used in C and C++ languages.

In structures and arrays also, using pointers simplifies every piece of code. But pointers do have security related problems, hence they were not included in JAVA language.

You can study about pointers in C language lessons of Studytonight.

Q :  What is the need of pointers...in structures and arrays...

7 years ago

iamabhishek

iamabhishek

You can Google it also, and you can also find it on Studytonight http://www.studytonight.com/dbms/er-diagram.php

Q :  What is a er diagram

7 years ago

iamabhishek

iamabhishek

Its there in Studytonight Data Structures lesson, http://www.studytonight.com/data-structures/merge-sort

Q :  Code of Merge Sort

7 years ago

iamabhishek

iamabhishek

Assert is used in JUNIT to assert any result whether its correct or not. Assert class has many static functions which can be used to do so, like assertNotNull, assertEquals.

To study more, go here http://junit.sourceforge.net/javadoc/org/junit/Assert.html

Q :  What is assert in java

7 years ago

iamabhishek

iamabhishek

Is there really a term Sugarcane in Networks. I have never come across it, if you find answer to this, do share with us also.

Q :  What is sugarcane in network?

7 years ago

iamabhishek

iamabhishek

Triggers are part of PL/SQL. A trigger is a pl/sql block structure which is fired when a DML statements like Insert, Delete, Update is executed on a database table. A trigger is triggered automatically when an associated DML statement is executed.

For Example: The price of a product changes constantly. It is important to maintain the history of the prices of the products.

For Example: The price of a product changes constantly. It is important to maintain the history of the prices of the products.

We can create a trigger to update the 'product_price_history' table when the price of the product is updated in the 'product' table. Hence, whenever you update price of product in the 'product' table, trigger will be executed and the product_price_history' table will be automatically updated.

Q :  Whta is trigger..??

7 years ago

iamabhishek

iamabhishek

goto is a keyword in Java, but it is marked as "not used".

goto will not do anything, as it is not meant to do anything in Java, but is still included into the keywords list. This was probably done in case it were to be added to a later version of Java.

Q :  What is the purpose of goto() in java?

7 years ago

iamabhishek

iamabhishek

A mask is used to determine what subnet an IP address belongs to.
An IP address has two components, the network address and the host address.
For example, consider the IP address 192.168.255.1 , Assuming this is part of a "OfficeA" network, the first two numbers (192.168) represent the OfficeA network address, and the second two numbers (255.1) identify a particular host(system attached) on this network.

Subnetting enables the network administrator to further divide the host part of the address into two or more subnets. In this case, a part of the host address is reserved to identify the particular subnet. This is easier to see if we show the IP address in binary format.

Q :  What is subnetting?

7 years ago

iamabhishek

iamabhishek

Java is a platform to build, it is of course an independent platform.

Q :  What is meant by java platform?

7 years ago

iamabhishek

iamabhishek

First of all you need to include Ed_id into Emp_Salary table and Emp_City table to relate all the details.

New tables :
1. Emp_Details(Ed_id, Ed_name, Ed_age, Ed_address)
2. Emp_Salary(Es_id, Ed_id_fk, Es_salary) (holds employee id with salaries)
3. Emp_City(Ec_id, Ed_id_fk, Ec_city) (holds employee id with their city)

After doing so, you can use the following SQL query to get Employee names.

Select D.Ed_name from D Emp_Details, S Emp_Salary, C Emp_CIty where D.Ed_id=S.Ed_id_fk and D.Ed_id=C.Ed_id_fk and C.Ec_city = "New Delhi" and S.Es_salary>30000

You must include Ed_id with all other tables holding details related to Employee, to relate all the data. I hope this answer helps you.

Q :  I have three tables and I need to do a join operation.

7 years ago

iamabhishek

iamabhishek

Android Application development tutorial videos are many more, you can find it from newboston's youtube channel. But the first 50 videos mentioned in here on Studytonight are the best ones for starting up.

Q :  Android Application Development tutorial contain only 50 videos is it enough?

7 years ago

iamabhishek

iamabhishek

SQL is a query language used to access and manage databases whereas MySql is a type of database. Other types of databases are MS-SQL, Oracle etc.

Q :  What is the basic diffrence between sql & my sql..??

7 years ago

iamabhishek

iamabhishek

You want to know all about Java, then you must study http://studytonight.com/java

And, &lt;meta&gt; is in HTML i guess.

Q :  What is <META> tage?

7 years ago

iamabhishek

iamabhishek

If you want to understand the simple meaning of String, then search it on Google or study lessons on Studytonight http://www.studytonight.com/java/string-handling-in-java.php

You should help us build up the standards of Studyroom. Please ask genuine problems.

Q :  What is the meaning of string in simple language?

7 years ago

iamabhishek

iamabhishek

In the code given, if you do not initialize i and print it, it will give you error, because i doesn't hold any value. But i couldn't understand, the first line, thats mentioned no. 1 in you question. What is that for ?

Q :  What should be the solution for this one ?

7 years ago

iamabhishek

iamabhishek

There is no download link for any video. You can watch the videos, we have collected links for videos.

Q :  Where is the code for spring

7 years ago

iamabhishek

iamabhishek

It depends on the code, if by multiple if-else you mean, 3 or 4, then i dont find any harm, but yes if you have to check many conditions, like 5 or more than 5, then switch case is best. It will make your code clean, and its usage is clearly understandable.

Q :  Which is more better condition checker : multiple if-else statements or switch case.

7 years ago

iamabhishek

iamabhishek

I cannot understand your question, please explain.

Q :  Why we called object as super class in java any specific result for that

7 years ago

iamabhishek

iamabhishek

Can you describe your question. What does this question means.

Q :  Hibernate

7 years ago

iamabhishek

iamabhishek

@om0406 , please do not post such suggestions here, you can go to Suggest Page and write this, this place is for queries.

Q :  Add computer networks and network security also

7 years ago

iamabhishek

iamabhishek

public class GenericExample<T> {<br/> <br/>    private T t;<br/>     <br/>    public T get(){<br/>        return this.t;<br/>    }<br/>     <br/>    public void set(T newt){<br/>        this.t=newt;<br/>    }<br/>     <br/>    public static void main(String args[]){<br/>        GenericExample<String> type = new GenericExample<>();<br/>        type.set("Studytonight");    //valid<br/>         <br/>        GenericExample type1 = new GenericExample();     //raw type<br/>        type1.set("Studytonight");    //valid<br/>        type1.set(10);      //valid and autoboxing support<br/>    }<br/>}
<br/><br/>In generics this is the major advantage, that you do not need to pre define a data type. Generics can be used with methods in Java.

Q :  Generic Class in Java

7 years ago

iamabhishek

iamabhishek

I think you should go through Studytonight C++ lessons. Everything is there.

Q :  Explain how pointers allocation takes place

7 years ago

iamabhishek

iamabhishek

HTML is a front end language used to design user interface, while interaction with database is server side. So you need a server side language to interact with database like php, jsp etc.<br/><br/>HTML is used along with server side language to create dynamic pages, in which server side communication is done by server side language and Front end is designed using HTML and CSS

Q :  How to link html page to database

7 years ago

iamabhishek

iamabhishek

Follow the lessons http://www.studytonight.com/java/setting-classpath-for-java.php<;br/><br/>If you have any other problem, please be specific.

Q :  How to compile java

7 years ago

iamabhishek

iamabhishek

An entity-relationship diagram. Because ER diagram is actually amongst the first few steps done while analysis. I think ER diagram is the answer. <br/><br/>And thanks for asking such great question. Do share correct answer with us if you know.

Q :  The primary deliverable from the conceptual data modeling step within the analysis phase is

7 years ago

iamabhishek

iamabhishek

BCNF is stricter than 3NF. BCNF is also called 3.5NF. BCNF acts differently from 3NF only when there are multiple overlapping candidate keys.

Q :  Bcnf implies 3nf

7 years ago

iamabhishek

iamabhishek

Java is called Fail fast, because in Java the error is shown as soon as it is detected, and execution stops. Fail Fast system will not try to rectify any error, instead it will directly display the error and stop execution.<br/><br/>Other type is Fail Safe, which is better, as it tries to solve errors itself, but is not accepted as in this case you never know where you are going wrong as no error will be displayed.<br/><br/>You can read more on this here : http://javapapers.com/core-java/fail-fast-vs-fail-safe/

Q :  Java Fail - Fast

7 years ago

iamabhishek

iamabhishek

I think it wont give any error, it will return the 5 rows. But i am a bit confused, is "Select 457 from employee" (employee being table name) is a correct query.

Q :  DBMS Query Question

7 years ago

iamabhishek

iamabhishek

Can you be a bit more clear with your questions. You post questions which are unclear, please help maintain the standard of our community. Thank you,

Q :  Upcoming java features after 1.7 interview question latest

7 years ago

iamabhishek

iamabhishek

Date/Time datatype can be found in MySql.<br/>Also you can simply save timestamp into Varchar datatype of MySql and can use it.<br/><br/>Specifically talking, timezone is the zone of Worldtime of a particular place like india has a timezone of +5:30. To consider this, you need to write your code corresponsing to this, because MySql will not provide any datatype for timezone.

Q :  How to assign timezone datatype in sql

7 years ago

iamabhishek

iamabhishek

We also have included some online courses related to this, check out this one by the New Boston http://www.studytonight.com/courses/android-application/

Q :  What are the basic programming knowledge required to built Android App?

7 years ago

iamabhishek

iamabhishek

As you mentioned a Login Page, hence for the user interface you have to use Applet or Swing, Core java can only provide the server side support.<br/><br/>Or, if you want to use only Core Java, you will have to create something like a Console Application.

Q :  How to create Login Page only using Core Java?

7 years ago

iamabhishek

iamabhishek

Hey kingsley, do you mean the UML diagram for a project ?

Q :  What is system integration diagram?

7 years ago

iamabhishek

iamabhishek

you can find great questions here.<br/><br/>http://www.indiabix.com/technical/dbms-basics/

Q :  Dbms

7 years ago

iamabhishek

iamabhishek

Can you be more descriptive, like what specialization you want to know. In what context it is ?

Q :  What is speciallization

7 years ago

iamabhishek

iamabhishek

One very Noted difference is that, in C++ Exception handling is there. <br/>Another important difference is, in C++ Virtual functions are there, and also Constructors and Destructors are there.

Q :  What is the difference between C++ and C language and object orianted programming

7 years ago

iamabhishek

iamabhishek

This is an article link http://www.programdiary.in/2012/12/login-system-using-servlet-and-jsp.html<;br/><br/>Here you will find a very simple implementation of Login System using Servlet, JSP and MySql

Q :  Servlet

7 years ago

iamabhishek

iamabhishek

CREATE USER [username] WITH ENCRYPTED PASSWORD '[password]';<br/><br/>This should create a User then you can use GRANT command to grant privileges to the user.

Q :  How to create individual user in a postgresql?

7 years ago

iamabhishek

iamabhishek

You can find about Function pointers on studytonight. read http://www.studytonight.com/c/pointer-with-function-in-c.php

Q :  What is the main use of function pointers in c?

7 years ago

iamabhishek

iamabhishek

Memory Leak is the runtime memory wastage due to objects which are no longer in use and are not garbage collected.<br/><br/>In case of string, as we all know in Java String object is immutable, so every time you change a String, a new String object is created, and the old one is also there. hence memory leak comes into picture.

Q :  What is memory leak in java?

7 years ago

iamabhishek

iamabhishek

We do not have virtual constructors, because constructors always produce instance of classes. Whenever we create any object always the super class constructor is called first and then the child class constructor is called, hence all the properties are included in instance of class. So we dont need Virtual constructors.<br/><br/>For understanding Virtual destructors, study http://www.studytonight.com/cpp/virtual-destructors.php

Q :  Why do we not have virtual constructor

7 years ago

iamabhishek

iamabhishek

Cookies are meant for information tracking and are stored in form of text file on the client side in http header. <br/>In servlets you can use request method request.getCookies() to access cookies.<br/>You need to follow following steps to create cookie and add it to response.<br/>

Cookie cookie = new Cookie("name","value");   // name value pair<br/>cookie.setMaxAge(60*60*24);    //setting age for cookie 24 hours<br/>response.addCookie(cookie);
<br/>This will add this cookie to response and will save it to client machine.<br/>The initial name-value pair is for the parameter for which you want to make a cookie data. Like in login you need firstname of user to be saved in cookie then you will create a cookie for firstname and add to resonse.<br/>If you want to add cookie for lastname also, you need to repeat the code for lastname also.

Q :  Hello every one : an any one help me to understand how cookie are managed with respective to browser

7 years ago

iamabhishek

iamabhishek

A parameterized cursor, is simply like a parameterized query. This cursor will ask for parameter value at runtime. Such cursors are usually used with FOR loops, because they are used in cases where you need to run a query again and again for different parameter values.<br/><br/>Pass parameter values to a cursor when the cursor is opened and the query is executed.<br/><br/>Example:<br/><br/>SQL><br/>declare<br/>cursor c1 (dd number) is select * from emp where deptno =dd;<br/>y number;<br/>begin<br/>    for x in c1(&y)
<br/>loop<br/>
insert into PROD values(x.empno,x.ename);<br/>
end loop;<br/>
end;<br/>
/<br/>
Enter value for y: 10<br/>
old 5: for x in c1(&y)<br/>
new 5: for x in c1(10)<br/>

Q :  What is parameterized cursor

7 years ago

iamabhishek

iamabhishek

For example, you have a table which has different products with their price lists, and you want to display all the products which have price between Rs.10 to Rs.20<br/><br/>SELECT * FROM Products<br/>WHERE Price BETWEEN 10 AND 20 ;<br/><br/>In this case we can use BETWEEN clause.

Q :  What is the format of using between clause

7 years ago

iamabhishek

iamabhishek

If you have a login system with email and password input, then user will enter his registered email address and password.<br/>You just need to take that entered email, use the SELECT query to fetch password corresponding to that email from the database, and match that with the password entered by user.<br/>If they match, redirect to homepage, else display error.

Q :  I want to connect with data base and i want to verify login details with database

7 years ago

iamabhishek

iamabhishek

null in Java is "nothing". When you dont want to specify any value to a variable you can make it null. null is not an instance of any Java class, also a null cannot be compared to be as zero.<br/>"null" is "Nothing"

Q :  What is null in java?

7 years ago

iamabhishek

iamabhishek

Schema, in simple language is the structure of any database. Schemas are created in data dictionary. Schema is the complete representation of a database, with tables, fields and their relationship.<br/><br/>A database, has tables, those tables have different fields, then there are tables which are interlinked through many integrity constraints. So this makes the structure definition too complex, this structure is called Schema.

Q :  What is schema ?

7 years ago

iamabhishek

iamabhishek

It obtains a reference to the class object with the FQCN (fully qualified class name) <br/>It doesn't "do" anything in terms of connecting to a database, aside from ensuring that the specified class is loaded by the current classloader. <br/>It can be used with JDBC drivers too. Actually with any class in Java.

Q :  What does class.forname() do??

7 years ago

iamabhishek

iamabhishek

Good answer @ramsmalula.<br/>Thanks for making this Studyroom productive, by posting answers and helping others.

Q :  Which is easier java or c ?

7 years ago

iamabhishek

iamabhishek

For more detailed explanation, please refer to this discussion at stackoverflow<br/>http://stackoverflow.com/questions/1597592/creating-a-super-simple-table-applet-in-java

Q :  How to create tables in applet??

7 years ago

iamabhishek

iamabhishek

class CustomTable extends JPanel {<br/> public CustomTable() {<br/> Object[][] cellData = {<br/> {"row1-col1", "row1-col2"},<br/> {"row2-col1", "row2-col2"}};<br/> String[] columnNames = {"col1", "col2"};<br/> add( new JTable(cellData, columnNames) ) ;<br/> }<br/>}

Q :  How to create tables in applet??

7 years ago

iamabhishek

iamabhishek

If you talk about the Servlet interface, it only has 5 methods, but there are some implementing classes, which adds many methods, like GenericServlet, FacesServlet and HttpServlet.

Q :  Do we have only 5 methods in servelet interface

7 years ago